Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

asp.net

vb.net

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")) '[email protected]
    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("[email protected]")
    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
like image 717
Er Paras Patel Avatar asked Dec 29 '25 22:12

Er Paras Patel


1 Answers

The user name or password must be incorrect, try with diferent user and password and check it out.}

Also verify the port to connect (eg. 587 )

like image 79
edgarmtze Avatar answered Jan 01 '26 19:01

edgarmtze