I have Hosted one of my website on netsol server. From there a contact.aspx
has to send email using exchange server. When I attempt to send an email:
Error: Mailbox unavailable. The server response was: 5.7.1 Unable to relay
Code:
MailMessage message = new MailMessage(@"[email protected]",
@"[email protected]",
"New Message",
"Exchange");
SmtpClient mail = new SmtpClient("exchange.abc.com", 29);
mail.EnableSsl = true;
mail.Credentials = new NetworkCredential(@"[email protected]", @"password");
mail.UseDefaultCredentials = false;
mail.DeliveryMethod = SmtpDeliveryMethod.Network;
mail.Send(message);
Options I tried:
- Tested on Port 465 or 587 or 25
- Changed SmtpDeliveryMethod.PickupDirectoryFromIis
- can't configure IIS (SMTP server) as it is hosted on someone else's server