Miguel Moura
Miguel Moura

Reputation: 39354

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

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

  1. Send email from [email protected] to [email protected]

    To send the email I am using the account [email protected]

    This works fine!

  2. Send email from [email protected] to [email protected]

    To send the email I am also using the account [email protected]

    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?

Upvotes: 1

Views: 9584

Answers (1)

Frazell Thomas
Frazell Thomas

Reputation: 6111

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.

Upvotes: 3

Related Questions