I have a windows application that i am using to send emails. i can send an email for any
one to his company mail directly (I am using domino server to send the mail)
for example i can send to test@landmarkgroup.com
but when i send to test@hotmail.com it is giving the following error
Transaction failed. The server response was: Relay rejected for policy reasons.
here is my code
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress("test@landmarkgroup.com")
MyMailMessage.To.Add("harb.nayef@hotmail.com")
MyMailMessage.Subject = txtSubject.Text
MyMailMessage.Body = txtBody.Text
Dim SMTPServer As New SmtpClient("112.12.29.62")
SMTPServer.Port = 25
SMTPServer.Send(MyMailMessage)
Yes, it fails because the Domino server has been setup to not accept SMTP relays from unknown sources (to avoid spam).
Contact the admin of the Domino server so that you can set up Domino to accept relay from machines running your application (if they can be uniquely identified), or from internal hosts (if that’s the case), and/or combined with a SMTP account to login to SMTP.