我的WinForms C#程序發送電子郵件。我用MailMessage
和SmtpClient
。 在SmtpClient
構造我通過smtp.gmail.com
和端口587C#Winforms應用程序發送電子郵件失敗:遠程名稱無法解析:'smtp.gmail.com;操作超時
這是工作我朋友的電腦上,但是當我嘗試它,我得到這個錯誤:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com'
System.Net.Mail.SmtpException: Operation Timed out
如何解決這個問題?爲什麼特定於我的電腦?
If i use port 25 i get exception : Operation Timed out
If i use port 587 i get exception : The remote name could not be resolved: 'smtp.gmail.com'
if i use port 465 i get exception : Operation Timed out
請更改您的標題與您的具體問題。閱讀[常見問題]和[問] – 2013-03-04 18:09:39
這看起來像一個簡單的DNS錯誤,你不能達到smtp.gmail.com – 2013-03-04 18:10:08
如果你ping ping smtp.gmail.com會發生什麼? – GalacticCowboy 2013-03-04 18:13:38