0

I don't know what is wrong i am transferring my files to a laptop and i am having trouble sending mail in php mailer where check my phpinfo in the laptop it seems ok in fact same as the one in my desktop..

SMTP smtp.mail.yahoo.com smtp.mail.yahoo.com smtp_port 25 25

the error is Could not connect to smtp host wrong

ive opened the openssl extension and the smtp is as u can see in case you need here is my code

$mail = new PHPMailer();

$mail->IsSMTP(); // send via SMTP
$mail->Host="smtp.mail.yahoo.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "******"; // SMTP username
$mail->Password = "******"; // SMTP password

$mail->From = "****";
$mail->FromName = "******";
$mail->AddAddress(******","*******");



$mail->WordWrap = 50; // set word wrap

$mail->IsHTML(true); // send as HTML

$mail->Subject = "Welcome to LilShop";

$mail->Body = ' Message ';

$mail->Send();

please help thanks

Andre malupet
  • 91
  • 3
  • 12

1 Answers1

0

Add

$mail->Port=465;
$mail->SMTPSecure = "tls"; 

and then it should work. Yahoo SMTP requires port and tls. You can also check out the PHPMailer examples here: http://phpmailer.worxware.com/index.php?pg=exampleasmtp

TddOrBust
  • 450
  • 2
  • 9