<?php
@require_once 'mail_master/PHPMailerAutoload.php';
@set_time_limit(0);




$send_to='smasenga@thefoundation.or.tz';

$mail_subject="Testing Template";


global $error;
$mail = new PHPMailer();  // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true;  // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = 'smtp.gmail.com'; //
$mail->Port = 465;
$mail->Username = "csoweek@gmail.com";
$mail->Password = "tvycktczujtyxezc";
$mail->SetFrom("information@thefoundation.or.tz", "CSOWEEK 2024");
$mail->Subject = $mail_subject;
$mail->AddAddress($send_to);

$mail->isHTML(true);
$mail->Subject = 'CSOWEEK 2024';
$mail->Body    = file_get_contents('temp.html');

if (!$mail->Send()) {
    $error = 'Mail error: ' . $mail->ErrorInfo;
    $response=array(
    "status"=>"202",
    "statusDesc"=>$error       
);
$response=json_encode($response);
//error_log("\n" . date('Y-m-d H:i:s') . " Response :\n $response ", 3, $destination);
print_r($response);
die();
} else {
    
    $response=array(
    "status"=>"200",
    "statusDesc"=>"Success"        
);
$response=json_encode($response);
//error_log("\n" . date('Y-m-d H:i:s') . " Response :\n $response ", 3, $destination);
print_r($response);
die(); 
    
}




