When trying to send out an email in a .NET site, the following error is being encountered:
Mailbox unavailable. The server response was: No such user here
Does this error appear if the code is trying to send to an email address which doesn't exist?
Thanks.
I now have more information about this error. The emails are sent from 'noreply@[domain]'. When the emails are sent to an email address of the same domain, the emails are sent without a problem. This error only appears when the email addresses being sent to are not from the same domain. I don't know if that's any use?
550 Blocked error or 550 Requested action not taken: mailbox unavailable is an SMTP (Simple Mail Transfer Protocol) error code. Put simply, this message means that the email you sent was blocked by the recipient's email hosting server, and returned to you.
A communication failure occurred during the delivery of this message. Please try to resend the message later. If the problem continues, contact your email admin.
If the basic variation of the SMTP 550 error – “550 requested action not taken mailbox unavailable” – is displayed, then the problem is usually that the intended target address couldn't be reached by the SMTP server.
This happens when you specify a domain with your NetworkCredentials. If you specify a domain (third argument) then you can only send to valid mailboxes within that domain. Leave it out to be able to send to any address outside the domain.
var client = new SmtpClient("smtp.server.com");
client.UseDefaultCredentials = false;
// The following will be able to send to anyone outside the domain.
client.Credentials = new NetworkCredential("user", "password");
// The following will only work when sending to users on server.com
client.Credentials = new NetworkCredential("user", "password", "server.com");
Could be that your password is incorrect. I had to reset the password on the mail server, then the error went away.
This may happen when you switch from 2.0 platform to 4.0. As it was explained here you need to tell IIS explicitly that you are not using default credentials and domain. Use the following syntax in web.config:
<network host="mail.younameit.com" port="25"
userName="[email protected]" password="youchoose"
defaultCredentials="false" clientDomain=""/>
The last two parameters are most important to fix this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With