richatkins
New Member
I knw this question may marked duplicate but i have not yet found the solution to my problem, so posting my question.I have Hosted one of my website on netsol server. From there a contact.aspx has to send mail using exchange server. Error: Mailbox unavailable. The server response was: 5.7.1 Unable to relayCode:\[code\] MailMessage message = new MailMessage(@"[email protected]", @"[email protected]", "New Message", "Exchange"); <br /> SmtpClient mail = new SmtpClient("exchange.abc.com", 29);<br /> mail.EnableSsl = true;<br /> mail.Credentials = new NetworkCredential(@"[email protected]", @"password");<br /> mail.UseDefaultCredentials = false;<br /> mail.DeliveryMethod = SmtpDeliveryMethod.Network;<br /> mail.Send(message);<br />\[/code\]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 other's server