我們爲使用Google Apps進行電子郵件的客戶設置了一個網站。使用Gmail(Google Apps)的ASP.NET 4.0郵件
在網站的聯繫我們部分,我們有一個表格,使訪問者發送消息。簡而言之,使用下面的代碼,但在「發送」過程中它總是超時。
Dim mysmtp = New System.Net.Mail.SmtpClient
mysmtp.Host = "smtp.gmail.com"
mysmtp.Port = 465
mysmtp.EnableSsl = True
mysmtp.Timeout = 15000 ' it times out a lot later after removing this..
Dim msg As System.Net.Mail.MailMessage
msg = New System.Net.Mail.MailMessage(from:="[email protected]", subject:="text", body:="still testing ...", [to]:="[email protected]")
Dim smtpAuthentication As New System.Net.NetworkCredential()
smtpAuthentication.Password = "mypwd"
smtpAuthentication.UserName = "[email protected]"
mysmtp.Credentials = smtpAuthentication
mysmtp.Send(msg)
我試過了,防火牆關閉了,反病毒軟件被禁用了。我正在使用Windows 7.
其他問題/表單中的解決方案都不起作用。問題可能不是代碼,但我迷路了。
任何幫助,將不勝感激!
你也許不是坐在一個網絡防火牆後面? – f0x 2012-03-27 07:14:39
不......我不知道。 – 2012-03-27 07:20:19