2013-07-24 174 views
0

我正在使用PHPMailer在PHP(PHP版本5.3.7)中生成郵件。但我一次又一次地嘗試過,但PHPMailer不能使用我的提供者的設置,但使用我的Gmail帳戶。 我的設置:PHPMailer和SMTP連接錯誤:節點名稱或服務名稱未知

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: [email protected] : Called Mail() without being connected 

請幫助我,由於我不知道是什麼原因造成這個錯誤,爲什麼?

回答

0

這聽起來像你的DNS服務器不解決smtp.strato.de。嘗試在服務器上打開命令提示符,然後鍵入:

nslookup smtp.strato.de 

它解決了嗎?如果沒有,請嘗試使用不同的DNS服務器(通過更改/etc/resolve.conf)。它確實在我測試的服務器上解析。

+0

我沒有訪問服務器控制檯,但正如我在下面寫的,我已經解決了這個問題。感謝您的幫助,如果錯誤再次出現,我會測試您的解決方案。 – user1995621

0

我自己的問題,似乎我忘了在PHPMailer中添加FROM電子郵件地址。

相關問題