Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

PHP Mailer problem

the mail() function

Moderators: macek, egami, gesf

PHP Mailer problem

Postby feedz87 » Thu Aug 30, 2012 12:23 am

Hi all,

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.. :help: :help:

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";
feedz87
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jul 04, 2011 10:24 pm

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.