My problem is when i run below code error Message was not sentMailer Error: SMTP Error: Could not connect to SMTP host will be shown.I have try for 2 week to settle this problem but still same result..
- Code: Select all
include ("../phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "172.11.112.22"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "West\haf"; // SMTP username
$mail->Password = "xxxx"; // SMTP password
$mail->From = "haf@West.com.my";
$mail->FromName = "Name";
$mail->AddAddress("haf@West.com.my","Name");
$mail->AddReplyTo("haf@West.com.my","Your Name");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML body";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";

