<?php
/**
 * This example shows settings to use when sending via Google's Gmail servers.
 * This uses traditional id & password authentication - look at the gmail_xoauth.phps
 * example to see how to use XOAUTH2.
 * The IMAP section shows how to save this message to the 'Sent Mail' folder using IMAP commands.
 */
//Import PHPMailer classes into the global namespace
//use PHPMailer\PHPMailer\PHPMailer;

require 'ajax/mailer/PHPMailerAutoload.php';
//Create a new PHPMailer instance
//Create a new PHPMailer instance
// if(isset($_GET['em']) && isset($_GET['::'])){
// $em = '';
// $id = "";
// $id = $_GET['::'];
// $em = $_GET['em'];
date_default_timezone_set('Africa/Accra');
$mail = new PHPMailer;
$mail->SMTPDebug = 3;
    $mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = 'smtp.gmail.com';  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = 'millsabeiku2@gmail.com';                 // SMTP username
    $mail->Password = 'Mills0555733180@';                           // SMTP password
    $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
    $mail->Port = 587;                                    // TCP port to connect to
//Set who the message is to be sent from
$mail->setFrom('team_support@mykonections.com', 'New Look Administration');
//Set an alternative reply-to address
$mail->addReplyTo('noreply@mykonections.com', 'New Look Support team');
//Set who the message is to be sent to
$mail->addAddress('millsabeiku2@gmail.com','user');
//Set the subject line

//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
//$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
    $mail->isHTML(true);
    $mail->Subject = 'PTA Meeting';                                  // Set email format to HTML
    //$mail->Subject = 'Here is the subject';
    $mail->Body    = 'There is going to be a PTA meeting next week Friday</b><img src="img/alpha.png">';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    //Attach an image file

//send the message, check for errors
if (!$mail->send()) {
   echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message sent!";
}
// }