我有这个代码,并且在我的本地服务器中都能正常工作。邮件发送没有任何问题。SMTP错误:无法连接到SMTP主机
但现在我通过内容,网络服务器,我得到这个错误...
SMTP Error: Could not connect to SMTP host.
SSL是能够在server..correct?那么,问题是什么?
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = "dnteiro"; // GMAIL username
$mail->Password = "xxx"; // GMAIL password
并且您的防火墙允许端口465连接之外? – Mel 2011-06-02 00:05:32
运行此php代码的服务器。 – Mel 2011-06-02 00:07:18
当然是伟大的中国防火墙。 – zerkms 2011-06-02 00:07:37