雷!Godaddy郵件政策

來黑一下Godaddy的郵件政策,本次遇到的Case是豪華版Wordpress託管建站,但是我看應該所有託管都面臨這個問題。

PHPMailer的解釋:

GoDaddy Popular US hosting provider GoDaddy imposes very strict (to the point of becoming almost useless) constraints on sending email. They block outbound SMTP to ports 25, 465 and 587 to all servers except their own. This problem is the subject of many frustrating questions on Stack Overflow. If you find your script works on your local machine, but not when you upload it to GoDaddy, this will be what’s happening to you. The solution is extremely poorly documented by GoDaddy: you must send through their servers, and also disable all security features, username and password (great, huh?!), giving you this config for PHPMailer:

$mail->isSMTP();
$mail->Host = 'relay-hosting.secureserver.net';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->SMTPSecure = false;

翻譯起來就是說,美國熱門的託管服務商Godaddy對電子郵件發送非常嚴格(幾乎無法使用),它們封鎖了25、465、587(實際上還有2525、2465、2587),這個問題在Stack Overflow使許多人感到沮喪。如果你的程式在本機運作良好,但是上傳到Godaddy時,您將會遇到這些狀況。Godaddy對此提供的替代方案非常糟糕,你必須使用他們的Mail Server,此外還必須關閉所有安全性設定(非常糟糕),以下是在Godaddy使用PHPMailer的設定:

註:紅字是我自己加的,原文在這裡


補刀:

此外,Godaddy不會寄出aol、gmail、yahoo、hotmail、live、aim、msn的電子信件,因為這些域名啟用了SPF與DKIM;但是他們會偽造其他的域名寄出電子郵件,若是這些域名也有啟用SPF與DKIM的話,顯然你的信件不是被丟棄就是跑到垃圾郵件資料夾了。

延伸閱讀:

電子郵件之安全

在〈雷!Godaddy郵件政策〉中有 4 則留言

  1. 大大你好!
    我搞不懂這方面的問題 可以問一下嗎?
    我用的是Linux Hosting with cPanel 和 phpmailer 6.0.5

    也是用了godaddy的建議(如下)
    $mail->isSMTP();
    $mail->Host = ‘relay-hosting.secureserver.net’;
    $mail->Port = 25;
    $mail->SMTPAuth = false;
    $mail->SMTPSecure = false;

    結果如下:
    Connection: opening to relay-hosting.secureserver.net:25, timeout=300, options=array()
    Connection failed. Error #2: stream_socket_client(): unable to connect to relay-hosting.secureserver.net:25 (Connection refused)
    SMTP ERROR: Failed to connect to server: Connection refused (111)

    大大給我一些建議嗎?
    先感謝一下

    回覆
    • 最近有使用Restful API的電子郵件服務商,用他們就可以了,不建議再死守去爸爸

      回覆

發佈留言