Jump to content

PHP Mailer (using yahoo email account)


PRodgers4284

Recommended Posts

I am having trouble with phpmailer, im trying to send an email from a yahoo account but everytime run the script it says:

 

Message was not sent.Mailer error: The following From address failed: ********@yahoo.com.

 

I was wondering if anyone has experience of this that could help me out.

 

My script is:

 


<?php

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host = "smtp.mail.yahoo.com:25"; // SMTP server

$mail->Username = '*********;

$mail->Password = '*********';

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

$mail->AddAddress("*********@yahoo.com");

 

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

$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";

$mail->WordWrap = 50;

 

if(!$mail->Send())

{

  echo 'Message was not sent.';

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

}

else

{

  echo 'Message has been sent.';

}

?>

Thanks

Link to comment
https://forums.phpfreaks.com/topic/92608-php-mailer-using-yahoo-email-account/
Share on other sites

Try setting $mail->SMTPAuth = true;

 

Thanks for the reply, appreciate it, i tried what you suggested:

 

I get the following error now:

 

"Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host. Thanks"

 

Is there any other configuration settings i need to change?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.