[thelist] PHPMailer can't connect to SMTP host
Nan Harbison
nan at nanharbison.com
Tue Jan 29 13:53:41 CST 2008
Hi Folks,
I am setting up PHPMailer on a website hosted on Godaddy. The PHPMailer
program does not appear to be using the mail() function in PHP. Has anyone
used this? Godaddy tells me if I am not using the regular PHP mail()
function, to set the host server to relay-hosting.secureserver.net, but I am
still getting the message:
Mailer Error: SMTP Error: Could not connect to SMTP host.
I can't figure out what I am doing wrong and the godaddy help files are
terrible. I have only created simple text emails before using mail().
I am sure my user name and pw are correct.
Here is the code required for the PHPMailer class:
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to
use SMTP
$mail->Host = "relay-hosting.secureserver.net"; // specify main and
backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "nan at domain.com"; // SMTP username
$mail->Password = "password"; // SMTP password
$mail->From = "nan at domain.com";
$mail->FromName = "BrainTrust Inc Registration";
$mail->AddAddress("johndoe at gmail.com", "John Doe"); / / name is optional
$mail->AddReplyTo("nan at domain.com", "BrainTrust Inc");
$mail->WordWrap = 50; // set word wrap
to 50 characters
$mail->IsHTML(true); // set email
format to HTML
Any suggestions?
Thanks
Nan
More information about the thelist
mailing list