email function
function sendAuthEmail($to,$subject,$body)
{
$mail_host = 'smtp.gmail.com';
$mail_port = 465;
$mail_username = 'abs.webref@gmail.com';
$mail_password = '123#';
if (!class_exists("phpmailer"))
{
include("application/third_party/email/class.phpmailer.php");
}
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages,
2 = messages only
$mail->Host = $mail_host; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Port = $mail_port; // or 587
$mail->Username = $mail_username; // SMTP username
$mail->Password = $mail_password; // SMTP password
$mail->From = "contact@geniustechgroup.com";
$mail->FromName = "Genius Tech Group";
$mail->AddAddress($to); // Email on we want to send mail
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $body;
if(!$mail->Send())
{
return false;
}
else
{
return true;
}
}