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