3

I'm running Windows server 2008 R2 but am getting smtp mail Exception :

Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

Codebehind :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim NewMail As New System.Net.Mail.MailMessage
    Dim str1 As String = String.Empty
    str1 = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings("SmtpEmail")) 'abc@example.com
    Dim fromaddress As MailAddress = New MailAddress(str1)
    NewMail.From = fromaddress
    NewMail.Sender = fromaddress
    NewMail.IsBodyHtml = True
    NewMail.Subject = "TEST"
    NewMail.Body = "This is Testing..."
    NewMail.Priority = System.Net.Mail.MailPriority.Normal
    NewMail.To.Add("xyz@example.com")
    Dim SmtpMail As New SmtpClient()
    SmtpMail.Port = 25
    SmtpMail.Host = ConfigurationManager.AppSettings("SmtpServer").ToString 'mail.xyz.com
    SmtpMail.Send(NewMail)
    NewMail.Dispose()
    SmtpMail.Dispose()
End Sub
4

1 回答 1

2

用户名或密码一定不正确,请尝试使用不同的用户名和密码并检查。}

还要验证要连接的端口 ( eg. 587)

于 2013-02-16T01:56:39.220 回答