tags:

views:

25

answers:

2

Possible Duplicate:
sending mails in php using yahoo smtp

require("class.phpmailer.php"); $mail = new PHPMailer();

$mail->IsSMTP();

$mail->SMTPAuth = true; // enable SMTP authentication

$mail->SMTPSecure = "ssl";

$mail->Host = "plus.smtp.mail.yahoo.com";

$mail->Port = 465; // set the SMTP port

$mail->Username = "[email protected]";

$mail->Password = "password";

$mail->From = "[email protected]";

$mail->FromName = "myname";

$mail->AddAddress("[email protected]");

$mail->Subject = "Test PHPMailer Message";

$mail->Body = "Hi! \n\n This was sent with phpMailer_example3.php.";

if(!$mail->Send()) {

echo 'Message was not sent.';

echo 'Mailer error: ' . $mail->ErrorInfo;

} else {

echo 'Message has been sent.';

} ?>

After the run it is showing:

SMTP Error: Could not authenticate. Message was not sent.Mailer error: SMTP Error: Could not authenticate. SMTP server error:

were is the error??

A: 

The error returned by PHP Mailer is usually accurate so make sure that you use the right credentials for the SMTP server.

Gabriel
A: 

Maybe username is sumthing, not [email protected] ? Also try first sending without SSL encryption, on normal SMTP port, if it works, you will know that problem is in SSL security.

killer_PL