Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc@gmail.com

老子叫甜甜 提交于 2019-12-11 08:08:17

问题


I am using the below code; One of the following points could be the reason of the error, but I don't know;

1-The application is on development machine 2-The smtp ip is hosted on the server while app is running on localhost

I am getting this error "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for mhtbusoum@gmail.com";

 Dim message As New MailMessage
 message.From = New MailAddress(Strings.LCase("mhtbusoum@mysite.com"))
 message.To.Add("mhtbusoum@gmail.com")
 message.IsBodyHtml = True
 message.Priority = MailPriority.Normal
 message.Subject = ("Testing SmtpClient email sending")
 message.Body = ("It is to test the email sending without any password")
 Dim client As New SmtpClient("mailSending.actualSite.com", 25)
 client.UseDefaultCredentials = False
 client.Send(message)

回答1:


When using localhost as mail server, the server will block any e-mail address that is not hosted in localhost.

To relay another e-mail address from other server, you will need to configure the IIS Server to grant the permission.

See this post for configure the relay permissions.




回答2:


Try this..

Find IIS6 manager (I have found that searching for IIS may return 2 results) go to the SMTP server properties then 'Access' then press the relay button.

Then you can either select all or only allow certain ip's like 127.0.0.1



来源:https://stackoverflow.com/questions/11505914/mailbox-unavailable-the-server-response-was-5-7-1-unable-to-relay-for-abcgmai

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