Пример #1
0
 public function sendEventRegistrationEmail($userID, $eveID, $conn)
 {
     $user = People::getUser($userID, $conn);
     $sql = "SELECT eveName FROM Events WHERE eveId = {$eveID}";
     $result = mysqli_query($conn, $sql);
     $row = mysqli_fetch_assoc($result);
     $eveName = $row['eveName'];
     $name = $user[1]['name'];
     $emailId = $user[1]['email'];
     // mail($to,$subject,$message);
     $message = "Hi {$name},<br>You have been registered for event<b> {$eveName}.</b> Thank You! <br>In case you have any registration related queries feel free to contact Aditya Gupta(+918292337923) or Arindam Banerjee(+919472472543) or drop an email to <i>registration@anwesha.info</i>. You can also visit our website <i>http://2016.anwesha.info/</i> for more information.<br><br>Registration Desk<br>Anwesha 2k16";
     $subject = "{$eveName} Registration Anwesha2k16";
     require 'resources/PHPMailer/PHPMailerAutoload.php';
     $mail = new PHPMailer();
     $mail->SMTPDebug = 0;
     $mail->isSMTP();
     // Set mailer to use SMTP
     $mail->Host = 'lnx36.securehostdns.com';
     // Specify main and backup SMTP servers
     $mail->SMTPAuth = true;
     // Enable SMTP authentication
     $mail->Username = '******';
     // SMTP username
     $mail->Password = '******';
     // SMTP password
     $mail->SMTPSecure = 'ssl';
     // Enable TLS encryption, `ssl` also accepted
     $mail->Port = 465;
     // TCP port to connect to
     $mail->setFrom('*****@*****.**', 'Anwesha Registration & Planning Team');
     $mail->addAddress($emailId, $name);
     // Add a recipient
     // $mail->addAddress('*****@*****.**');               // Name is optional
     $mail->addReplyTo('*****@*****.**', 'Registration & Planning Team');
     // $mail->addCC('*****@*****.**');
     // $mail->addBCC('*****@*****.**');
     // $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
     // $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
     $mail->isHTML(true);
     // Set email format to HTML
     $mail->Subject = $subject;
     $mail->Body = $message;
     $mail->AltBody = "Hi {$name},\nYou have been registered for event {$eveName}. Thank You!\nIn case you have any registration related queries feel free to contact Aditya Gupta(+918292337923) or Arindam Banerjee(+919472472543) or drop an email to registration@anwesha.info. You can also visit our website http://2016.anwesha.info/ for more information.\nRegistration Desk\nAnwesha 2k16";
     $mail->send();
 }
<?php

require 'model/model.php';
require 'dbConnection.php';
$userID = $match[1];
$conn = mysqli_connect(SERVER_ADDRESS, USER_NAME, PASSWORD, DATABASE);
$user = People::getUser($userID, $conn);
if ($user[0] != 1) {
    mysqli_close($conn);
    header('Content-type: application/json');
    echo json_encode(array("status" => false, "msg" => $user[1]));
    die;
}
$user = $user[1];
$loginInfo = People::getUserLoginInfo($userID, $conn);
if ($loginInfo[0] != 1) {
    mysqli_close($conn);
    header('Content-type: application/json');
    echo json_encode(array("status" => false, "msg" => "Error! Contact Registration Desk Immediately."));
    die;
}
mysqli_close($conn);
$loginInfo = $loginInfo[1];
if (is_null($loginInfo['password'])) {
    header('Content-type: application/json');
    echo json_encode(array("status" => false, "msg" => "Account already verified."));
    die;
}
People::Email($user['email'], $user['name'], $loginInfo['csrfToken'], $userID);
header('Content-type: application/json');
echo json_encode(array("status" => true, "msg" => "Verification link sent to registered email."));
Пример #3
0
 public function sendEventRegistrationEmail($userID, $eveID, $conn)
 {
     require 'defines.php';
     $user = People::getUser($userID, $conn);
     $sql = "SELECT eveName FROM Events WHERE eveId = {$eveID}";
     $result = mysqli_query($conn, $sql);
     $row = mysqli_fetch_assoc($result);
     $eveName = $row['eveName'];
     $name = $user[1]['name'];
     $emailId = $user[1]['email'];
     // mail($to,$subject,$message);
     $message = "Hi {$name},<br>You have been registered for event<b> {$eveName}.</b> Thank You! <br>In case you have any registration related queries feel free to contact {$ANWESHA_REG_CONTACT} or drop an email to <i>{$ANWESHA_YEAR}</i>. You can also visit our website <i>{$ANWESHA_URL}</i> for more information.<br><br>Registration Desk<br>{$ANWESHA_YEAR}";
     $subject = "{$eveName} Registration {$ANWESHA_YEAR}";
     require 'resources/PHPMailer/PHPMailerAutoload.php';
     require 'emailCredential.php';
     $mail = new PHPMailer();
     $mail->SMTPDebug = 0;
     $mail->isSMTP();
     // Set mailer to use SMTP
     $mail->Host = MAIL_HOST;
     // Specify main and backup SMTP servers
     $mail->SMTPAuth = MAIL_SMTP_AUTH;
     // Enable SMTP authentication
     $mail->Username = MAIL_USERNAME;
     // SMTP username
     $mail->Password = MAIL_PASSWORD;
     // SMTP password
     $mail->SMTPSecure = MAIL_SMTP_SECURE;
     // Enable TLS encryption, `ssl` also accepted
     $mail->Port = MAIL_PORT;
     // TCP port to connect to
     $mail->setFrom($ANWESHA_YEAR, 'Anwesha Registration & Planning Team');
     $mail->addAddress($emailId, $name);
     // Add a recipient
     // $mail->addAddress('*****@*****.**');               // Name is optional
     $mail->addReplyTo($ANWESHA_YEAR, 'Registration & Planning Team');
     // $mail->addCC('*****@*****.**');
     // $mail->addBCC($ANWESHA_YEAR);
     // $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
     // $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
     $mail->isHTML(true);
     // Set email format to HTML
     $mail->Subject = $subject;
     $mail->Body = $message;
     $mail->AltBody = "Hi {$name},\nYou have been registered for event {$eveName}. Thank You!\nIn case you have any registration related queries feel free to contact {$ANWESHA_REG_CONTACT} or drop an email to {$ANWESHA_YEAR}. You can also visit our website http://2017.anwesha.info/ for more information.\nRegistration Desk\nAnwesha 2k17";
     $mail->send();
 }