【问题标题】:Connection error with PHPMailer and SMTP: node name or service name not knownPHPMailer 和 SMTP 连接错误:节点名称或服务名称未知
【发布时间】:2013-07-24 05:26:33
【问题描述】:

我正在使用 PHPMailer 在 PHP(PHP 版本 5.3.7)中生成邮件。但是我一次又一次地尝试过,但是 PHPMailer 不能使用我的提供商的设置,而是使用我的 gmail 帐户。 我的设置:

SMTP = true
SMTPAuth = true
CharSet = UTF-8
SethSecure = ""
Host = smtp.strato.de
User = myemail
Password = **********
port = 587

但是 PHPMailer 返回以下消息(在调试模式下):

SMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed:
node name or service name not known (0)
The following From address failed: info@burk-co.com : Called Mail() without being connected

由于我不知道导致此错误的原因以及原因,请帮助我?

【问题讨论】:

    标签: php email smtp phpmailer smtp-auth


    【解决方案1】:

    我自己的问题,好像是我忘记在PHPMailer中添加FROM电子邮件地址了。

    【讨论】:

      【解决方案2】:

      听起来您的 DNS 服务器无法解析 smtp.strato.de。尝试在您的服务器上打开命令提示符,然后输入:

      nslookup smtp.strato.de
      

      解决了吗?如果没有,请尝试使用不同的 DNS 服务器(通过更改 /etc/resolve.conf)。事实上,它确实在我测试过的服务器上解析。

      【讨论】:

      • 我无法访问服务器控制台,但正如我在下面所写的,我已经解决了这个问题。感谢您的帮助,如果再次出现错误我会测试您的解决方案。
      猜你喜欢
      • 2021-02-27
      • 2018-03-07
      • 1970-01-01
      • 1970-01-01
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-10
      相关资源
      最近更新 更多