1
我试图使用PHPMailer从我的hotmail帐户发送电子邮件。它的正常工作,从我的电脑,但是当我尝试另一台电脑上我收到此错误信息:SMTP连接()失败PHP邮件程序
2015年4月23日17时31分18秒客户端 - >服务器:EHLO本地主机
2015年4月23日17:31:18客户端 - >服务器:退出
2015-04-23 17:31:18 SMTP connect()失败。梅勒错误
这里是我的代码:
<?php
require "C:\wamp\www\PHPMailer-master\PHPMailerAutoload.php";
$mail = new PHPMailer();
$mail->SMTPSecure = 'SSL';
$mail->Username = "[email protected]";
$mail->Password = "rerered";
$mail->AddAddress("[email protected]");
$mail->FromName = "My Name";
$mail->Subject = "My Subject";
$mail->Body = "My Body";
$mail->Host = "smtp.live.com";
$mail->Port = 587;
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->From = $mail->Username;
if(!$mail->Send())
{
echo "Mailer Error";
}
else
{
echo "Message has been sent";
}
?>
端口587是否在此“另一台”PC上打开? –
我怎么知道它? –
[PHPMaililer的SMTP错误]的可能的重复(http://stackoverflow.com/questions/4185942/smtp-error-with-phpmailer) – Synchro