Aggiunta connessione con mysql
This commit is contained in:
parent
1e6b4a1374
commit
a7de9454ae
1 changed files with 12 additions and 0 deletions
12
sender.php
12
sender.php
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
require_once 'vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
|
||||
include_once 'config/config.php';
|
||||
include_once "vendor/notorm/NotORM.php";
|
||||
|
||||
|
||||
function getToken($length = 12){
|
||||
return uniqId();
|
||||
|
@ -17,6 +19,14 @@ function generateLink($url, $token, $ml, $email){
|
|||
return $link.$token.$ml.$email;
|
||||
}
|
||||
|
||||
$pdo = new PDO("mysql:host=".$db_host.";dbname=".$db_dbname,
|
||||
$db_user,
|
||||
$db_pass
|
||||
);
|
||||
|
||||
$db = new NotORM($pdo);
|
||||
var_dump($db);
|
||||
exit();
|
||||
$mail = new PHPMailer;
|
||||
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
|
@ -42,6 +52,8 @@ while(!feof($file)){
|
|||
$token = getToken();
|
||||
$link = generateLink($mlrollmember_url, $token, $ml, $sanitized_mail);
|
||||
$mail->AltBody = $def_body.$link;
|
||||
|
||||
|
||||
|
||||
if(!$mail->send()) {
|
||||
echo 'Message could not be sent.';
|
||||
|
|
Loading…
Reference in a new issue