开发者

want to send mails from php using yahoo smtp [duplicate]

This question already has answers here: 开发者_JAVA技巧 Closed 12 years ago.

Possible Duplicate:

sending mails in php using yahoo smtp

<?php

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 = "sumthing@yahoo.com";

$mail->Password = "password";

$mail->From = "sumthing@yahoo.com";

$mail->FromName = "myname";

$mail->AddAddress("you@example.com");

$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??


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜