在使用asp.net 4.0的Web应用程序中,我使用类System.Net.Mail.SmtpClient
发送电子邮件。
这是我的代码:
Shared Function InviaMail(ByVal toAddress As String, ByVal TestoMsg As String, ByVal TestoSubject As String) As Boolean
Dim from As New MailAddress("xxx@xxx.pro", "xxx.pro")
Dim toDest As New MailAddress(toAddress, "")
Dim mm As New MailMessage(from, toDest)
Dim altView As AlternateView
altView = AlternateView.CreateAlternateViewFromString(TestoMsg, Nothing, MediaTypeNames.Text.Html)
mm.AlternateViews.Add(altView)
mm.Subject = TestoSubject
mm.Body = TestoMsg
mm.IsBodyHtml = True
Dim smtp As New SmtpClient
Try
smtp.Send(mm)
mm.Dispose()
mm = Nothing
smtp.Dispose()
smtp = Nothing
Return True
Catch ex As Exception
Return False
End Try
End Function
一段时间以来,每当我尝试发送电子邮件时,都会收到此错误:
Mailbox unavailable. The server response was: 5.2.0 Jhw61q00C2SXeFl01 Spam Rejected
我搜索了几个小时的解决方案,但没有找到任何信息。
请帮助我了解发生了什么,以及为什么我收到此错误。如果您需要更多信息,我会提供,但请尽量帮助我。
答案 0 :(得分:0)
经过更多测试,我认为问题是由于互联网服务提供商的反垃圾邮件政策的提出。我会向我的提供者索要。