發送信件到 Google 時會被退信並收到退信訊息訊息
Reporting-MTA: dns; ssdserver02.twservers.net
Action: failed
Final-Recipient: rfc822;xxxxxxxx@gmail.com
Status: 5.0.0
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.26 Your email has been blocked because the sender is unauthenticated.
550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM.
550-5.7.26
550-5.7.26 Authentication results:
550-5.7.26 DKIM = did not pass
550-5.7.26 SPF [ssdserver02.twservers.net] with ip: [60.249.45.229] = did not
550-5.7.26 pass
550-5.7.26
550-5.7.26 For instructions on setting up authentication, go to
550 5.7.26 https://support.google.com/mail/answer/ ... entication 98e67ed59e1d1-2bdd9ed265esi2763991a91.21 - gsmtp
以上錯誤訊息的原因是由於你的程式沒有呼叫任何一個信箱進行登入的動作然後發送信件,
而是直接呼叫主機發送信件,
因此在追蹤傳送的寄件者會看見下方圖片中這種格式
註:在 cpanel 查詢信件紀錄請參考教學文章
http://forum.webdsn.net/viewtopic.php?f=27&t=3522
這是因為呼叫本機發送信件的話,這個信箱並不存在,
由於現在 google 的政策是,
1.發送信件的信箱必須真實存在,
2.而且這個信箱所使用的網域必須要有設定對應的 MX 跟 SPF 紀錄
註:透過 cPanel 設定 SPF 紀錄請參考教學文章
http://forum.webdsn.net/viewtopic.php?f=27&t=3545
3.在程式的部分必須設定連上郵件主機 mail.你們的網址,並且有使用帳號密碼登入該主機
例. mail.webdsn.com.tw
(這是範例,後面的 webdsn.com.tw 請提換成你自己的網址)
註:使用 cPanel 建立信箱請參考教學文章
http://forum.webdsn.net/viewtopic.php?f=27&t=3530
只要以上三點不符合要求,就會被 Google 無條件退信。