2009-12-09 23 views
0

我應該注意些什麼呢?

IIS 7 Win2k8,使用ASP.NET W/C#

SmtpClient smtpClient = new SmtpClient(); 
smtpClient.EnableSsl = true; 
smtpClient.Send(fromAddress, toAddress, subject, body); 
+0

哪個IIS版本,什麼語言/ framwork? ASP,.NET,PHP?你用什麼組件發送郵件? – Kev 2009-12-09 19:06:40

+0

添加到上面的文本 – drewburlingame 2009-12-09 21:54:09

回答

0

的Gmail requires authentication從SMTP客戶端,所以你需要在SmtpClient實例上填寫Credentials屬性,如here所示。

這並不能解釋它爲什麼在你的開發框中工作(除非POP3方法仍然有效),但它可以解釋爲什麼你顯示的代碼不起作用。

0

包裝smtpClient.Send(fromAddress, toAddress, subject, body);一個嘗試catch語句內的和看到的異常是什麼

+0

我故意沒有在該網頁上發現任何異常情況,以便我能看到例外情況,但沒有發現。據我所知,沒有例外被拋出。 – drewburlingame 2009-12-10 00:12:40

相關問題