【发布时间】:2023-03-09 12:45:01
【问题描述】:
我正在尝试在 Windows 2008 Server 上设置伪造的 sendmail (sendmail.exe),以便 PHP(最终是 Joomla)可以使用我的提供商的 SMTP 服务器发送消息。但是,在使用 XAMPP 的简单电子邮件表单时,我不断收到以下错误:
Socket Error # 10061<EOL>Connection refused.
这似乎很奇怪,因为我可以使用 Thunderbird 和相同的 SMTP 配置从这台机器发送邮件。以下是 sendmail.ini 中的相关条目:
smtp_server=smtp.1und1.de
smtp_port=587
smtp_ssl=auto
auth_username=<email>
auth_password=<password>
尝试强制 SSL 或 TLS 无效。
sendmail 的 debug.log:
14.03.17 13:37:17 ** --- MESSAGE BEGIN ---
14.03.17 13:37:17 ** To: <recipient email>
14.03.17 13:37:17 ** Subject: Test
14.03.17 13:37:17 ** MIME-Version: 1.0
14.03.17 13:37:17 ** Content-type: text/html; charset=iso-8859-1
14.03.17 13:37:17 ** To: <recipient email>
14.03.17 13:37:17 ** From: <sender email>
14.03.17 13:37:17 **
14.03.17 13:37:17 ** test test
14.03.17 13:37:17 ** --- MESSAGE END ---
14.03.17 13:37:18 ** Connecting to smtp.1und1.de:587
14.03.17 13:37:18 ** Disconnected.
14.03.17 13:37:18 ** Disconnected.
14.03.17 13:37:18 ** Disconnected.
14.03.17 13:37:18 ** Socket Error # 10061<EOL>Connection refused.
感谢任何帮助。
【问题讨论】:
-
telnet smtp.1und1.de 587结果如何? -
连接到 smtp.1und1.de...无法打开与主机的连接,在端口 587 上:连接失败
-
在服务器
smtp.1und1.de的防火墙中打开587端口 -
感谢您的回答。那是我的电子邮件提供商的服务器,所以我无法控制它。 Thunderbird 可以使用该端口与它正常通信。会不会是我这边的防火墙有问题?
-
你确定 smtp 端口是 587 吗?也试试 25 。这是默认端口。
标签: php windows smtp sendmail.exe