HELO Error when sending with Net.Mail.SmtpClient

时光毁灭记忆、已成空白 提交于 2019-12-13 05:02:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!