This error indicates that your application is unable to connect with your mail server. you need to check with your mail server, is everything working fine?
you need to check also that you are passing server name and port in right way.
Wrong:
- client.Host = "mail.someco.com:10000";
- clicnt.Host = "mail.someco.com"; client.Port = 10000;
- var smptClient = new SmtpClient("smtp.gmail.com", 587)
- {
- Credentials = new NetworkCredential("[email protected]", "123456789"),
- EnableSsl = true
- };
- smptClient.Send("[email protected]", "[email protected]", "Testing Email", "testing the email");

Darshan ManjrekarPosted Mar 15, 2018, 10:41 AM
I have tried everything still im getting run time exception failure sending mail and inner exception as {"Unable to connect to the remote server"}
Santhakumar MunuswamyPosted Dec 4, 2015, 1:55 PM
Nice share
John WallacePosted Dec 2, 2015, 3:43 AM
Thank you for posting..nice article. http://www.clazwork.com