<?php
include('smtp/PHPMailerAutoload.php');

function smtp_mailer($to,$subject,$msg){


	$mail = new PHPMailer(); 
	//  $mail->SMTPDebug=3;
	
	$mail->IsSMTP(); 
    $mail->SMTPDebug = 1; 
    $mail->SMTPAuth = true; 
    $mail->SMTPSecure = 'ssl'; 
    $mail->Host = "mail.addmyentry.com";
    
    $mail->Port = 465; 
    $mail->IsHTML(true);
    //Username to use for SMTP authentication
    $mail->Username = "admin@addmyentry.com";
    $mail->Password = "$)kcy06W%(+7";
    //Set who the message is to be sent from
    $mail->setFrom('admin@addmyentry.com', 'Addmyentry');
    
    $mail->addAddress($to);
    //Set the subject line
    $mail->Subject = $subject;
    $mail->Body = 'hgsd';
    //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("convert HTML into a basic plain-text alternative body");
    //Replace the plain text body with one created manually
    // $mail->AltBody = $msg;

    //send the message, check for errors
    if (!$mail->send()) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    } else {
        echo "Message sent!";
    }
    
// 	$mail->IsSMTP(); 
// 	$mail->SMTPAuth = true; 
// 	$mail->SMTPSecure = 'ssl'; 
// 	$mail->Host = "mail.addmyentry.com";
// 	$mail->Port = "465 "; 
// 	$mail->IsHTML(true);
// 	$mail->CharSet = 'UTF-8';
// 	$mail->Username = "admin@addmyentry.com";
// 	$mail->Password = '$)kcy06W%(+7';
// 	$mail->SetFrom("admin@addmyentry.com");
// 	$mail->Subject = $subject;
// 	$mail->Body =$msg;
// 	$mail->AddAddress($to);
// 	$mail->SMTPOptions=array('ssl'=>array(
// 		'verify_peer'=>false,
// 		'verify_peer_name'=>false,
// 		'allow_self_signed'=>false
// 	));
// 	if(!$mail->Send()){
// 		echo $mail->ErrorInfo;
// 	}else{
// 		// echo 'Sent';
// 	}
}


?>
