PHPMailer和SMTP的连接错误:节点名称或服务名称未知 [英] Connection error with PHPMailer and SMTP: node name or service name not known
问题描述
我正在使用PHPMailer在PHP(PHP版本5.3.7)中生成邮件.但是我已经尝试了一次又一次,但是PHPMailer不适用于我的提供商的设置,而不能用于我的gmail帐户. 我的设置:
I'm using PHPMailer to generate mails in PHP (PHP Version 5.3.7). But I have tried it again and again, but PHPMailer doesn't work with the settings from my provider but with my gmail account. My settings:
SMTP = true
SMTPAuth = true
CharSet = UTF-8
SethSecure = ""
Host = smtp.strato.de
User = myemail
Password = **********
port = 587
但是PHPMailer返回以下消息(在调试模式下):
But PHPMailer returns the following messages (in debug mode):
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
由于我不知道是什么原因导致了此错误,为什么原因,请帮助我
Please help me due to I don't know what has caused this error and why?
推荐答案
听起来您的DNS服务器没有解析smtp.strato.de.尝试在服务器上打开命令提示符,然后键入:
It sounds like your DNS server is not resolving smtp.strato.de. Try opening a command prompt on your server, and typing:
nslookup smtp.strato.de
它解决了吗?如果不是,请尝试使用其他DNS服务器(通过更改/etc/resolve.conf).实际上,它确实可以在我测试过的服务器上解决.
Does it resolve? If not, try using a different DNS server (by change /etc/resolve.conf). It does in fact resolve on a server that I tested from.
这篇关于PHPMailer和SMTP的连接错误:节点名称或服务名称未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!