title: 'System.Net.Mail.SmtpException: Failure sending mail from remote mail server
body: <p>i tried to send mail from a VPS windows 2012 &amp; IIS 8 server  using a remote mail server , i couldn't sent mails,and got the error</p>
  
  <pre><code>send Faild - System.Net.Mail.SmtpException: Failure sending mail. ---&gt; System.Net.WebException: Unable to connect to the remote server ---&gt; 
  System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time,
  or established connection failed because connected host has failed to respond &lt;Ip Address&gt; at System.Net.Sockets.Socket.DoConnect(EndPoint 
  endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6,
  Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception) --- End of inner exception stack 
  trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress&amp; address, Socket&amp; abortSocket,
  Socket&amp; abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) at     System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at     System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of 
  inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at WebApplication1.Default.Page_Load(Object sender, EventArgs e) 
  </code></pre>
  
  <p>code used</p>
  
  <pre><code>&lt;%
  
  Dim Email As New System.Net.Mail.MailMessage( _"emails@domain.org", "email@domain.org")
  Email.Subject = "test subject"
  Email.Body = "this is a test"
  Dim mailClient As New System.Net.Mail.SmtpClient()
  'This object stores the authentication values
   Dim basicAuthenticationInfo As _
  New System.Net.NetworkCredential("username", "password")
  mailClient.Host = "host"
  mailClient.UseDefaultCredentials = False
  mailClient.Credentials = basicAuthenticationInfo
  mailClient.Send(Email)
  
  %&gt;
  </code></pre>
  
  <p>update</p>
  
  <p>not able to telnet smtp server from the vps, but from local systems its possible.</p>