Unable to send email on production server with ASP.NET MVC
- by Davide Vosti
I have a simple ASP.NET MVC application with a contact page.
In my development machine (local) I can send successfully emails (I specify host and credentials), but on the production server this doesn't work and I get this error:
System.Net.Mail.SmtpFailedRecipientException:
Mailbox unavailable. The server
response was: Requested action not
taken: mailbox unavailable or not
local at
System.Net.Mail.SmtpTransport.SendMail...
The server is in my LAN (the mail server too). I tried with multiple accounts but I have errors every time.
Credentials for the account are provided at runtime with
smtp.Credentials = new NetworkCredential("username", "password");
Any idea?
Thanks