问题
When I try to send a simple e-mail using Net.Mail.SmtpClient I get an error
Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
The weird thing is that it works on my home computer, but not on the office computer.
Where or what can be the problem?
The code is written in VB.NET (.NET Framework 2.0):
Dim sendMail As New SmtpClient("mail.myhost.com", 25)
sendMail.UseDefaultCredentials = False
sendMail.Credentials = New Net.NetworkCredential("user@myhost.com", "123")
sendMail = New Net.Mail.SmtpClient("mail.myhost.com", 25)
Dim mail As New MailMessage()
mail.From = New MailAddress("user@myhost.com", "Jack SMITH")
Dim maTO As MailAddress = New MailAddress("someone@gmail.com", "John DOE")
mail.To.Add(maTO)
mail.Subject = "The mail subject"
mail.Body = "The mail body"
mail.IsBodyHtml = False
sendMail.Send(mail)
mail.Dispose()
来源:https://stackoverflow.com/questions/26466101/helo-error-when-sending-with-net-mail-smtpclient