【发布时间】:2014-04-29 16:26:41
【问题描述】:
我在使用 PHPMailer 时遇到了一些问题 - 它无法连接到 SMTP 服务器。 我使用以下设置:
$mail->Host = "mail.site.com";
$mail->SMTPAuth = true;
$mail->Port = 26;
$mail->Username = "test@site.com";
$mail->Password = "***";
当我尝试连接时 - 我收到错误“SMTP 错误:无法连接到 SMTP 主机”。 我也尝试设置:
$mail->SMTPSecure = 'ssl';
OR
$mail->SMTPSecure = 'tls';
但错误仍然存在。
在我的电子邮件客户端 (Thunderbird) 中设置:
Server - mail.site.com
Port - 26
Secure Connection - STARTTLS
Username - test@site.com
我连接成功并且可以发送/接收电子邮件。同样通过 telnet mail.site.com 26 我成功连接。
为什么相同的设置无法连接到服务器?
【问题讨论】: