function sendMail($to,$subject,$message)
{
require_once('includes/class.phpmailer.php');
$mail = new PHPMailer(); // create a new object
//$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true;
//$mail->SMTPSecure = 'ssl';
$mail->Host = "mail.nanyanglaw.com";
$mail->Port = 25;
$mail->IsHTML(false);
$mail->Username = "xxx@xxx.com";
$mail->Password = "xxx";
$mail->SetFrom("xxx@xxx.com","e-Voucher");
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAddress($to);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo.'<br>';
echo "Host: " . $mail->Host.'<br>';
echo "Port: " . $mail->Port.'<br>';
}
//else
// echo "Message has been sent";
}
I keep getting this error, after migrating to a new server. Was working fine on the last server using the same code. I tried enable $mail->IsSMTP(), but the page stop running all together and shows no error, total blank screen.
I've checked the error log but find nothing there.
UPDATE: Found out that the class.mail.php went missing during the migration. Thanks for the help.