How to Resolve Unable to Connect to the Remote Server When Sending Email

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.


  1. client.Host = "";    
  1. clicnt.Host = ""; client.Port = 10000;    
and if you are using some other server like you are trying to send the email using gmail. then check your port You can try this code.

  1. var smptClient = new SmtpClient("", 587)  
  2.  {  
  3.      Credentials = new NetworkCredential("[email protected]""123456789"),  
  4.      EnableSsl = true  
  5.  };  
  6.   smptClient.Send("[email protected]""[email protected]""Testing Email""testing the email");  
Ebook Download
View all
View all