Connection error with PHPMailer and SMTP: node name or service name not known

谁说胖子不能爱 提交于 2019-12-08 10:23:28

问题


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

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?


回答1:


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

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.




回答2:


I have the problem on my own, it seems that I have forgotten to add the FROM email adresse in PHPMailer.



来源:https://stackoverflow.com/questions/17839056/connection-error-with-phpmailer-and-smtp-node-name-or-service-name-not-known

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!