【问题标题】:Fake Sendmail on Windows won't connect to SMTP serverWindows 上的虚假 Sendmail 无法连接到 SMTP 服务器
【发布时间】: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


【解决方案1】:

您可以选择使用 gmail smtp 服务器或使用本地水星服务器。

如果您想使用gmail服务器,您可以在以下问题的答案中找到说明:

How to configure XAMPP to send mail from localhost?

如果你想使用xampp自带的mercury服务器,你可以试试以下方法:

http://system66.blogspot.in/2010/01/how-to-send-mail-from-localhost-with.html

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-13
    • 2020-09-19
    • 1970-01-01
    相关资源
    最近更新 更多