Mailbox unavailable. The server response was: Authentication is required for relay

asp.netemail

I am sending emails in ASP.NET and I have two situations:

  1. Send email from UserXYZ@ItsDomain.com to Info@MyDomain.com

    To send the email I am using the account Robot@MyDomain.com

    This works fine!

  2. Send email from Robot@MyDomain.com to UserXYZ@ItsDomain.com

    To send the email I am also using the account Robot@MyDomain.com

    In this case I get the error:

    Mailbox unavailable. The server response was: Authentication is required for relay

    System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Authentication is required for relay at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at …

I have no idea what is happening because I have all the autentication data in Web.Config and the first sending is working fine …

Any idea?

Best Answer

The error is the mail server saying you don't have permission to relay. Relaying is the process of using one mail server to send mail to another (it is acting as a post man in the real world).

Due to spam issues most mail server will not allow this.

You'll need to setup an SMTP server to relay from or get access to an appropriate mail server to relay from. Most ISPs or hosting providers will provide you with a relay server that you can use.

Related Topic