PHP Mailer problem

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Mon Jul 04, 2011 10:24 pm

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 = ""; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "West\haf"; // SMTP username
$mail->Password = "xxxx"; // SMTP password

$mail->From = "";
$mail->FromName = "Name";
$mail->AddReplyTo("","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";

echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;

echo "Message has been sent";

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 2 guests