title: C# Email sending error on Godaddy server
body: <p>I have one web application which hosted on Godaddy server. I am stuck with Failure sending mail error. I place my code here    </p>
  
  <pre><code>public void Mailing()
  {
   MailMessage message = new MailMessage();
   try
  {
      MailAddress fromAddress = new MailAddress("mailadress@server.net");
      message.From = fromAddress;
      message.To.Add("toresive@server.com");
      message.CC.Add("ccresive@server.com");
  
      message.Subject = "Hello client";
      message.IsBodyHtml= true;
      string body = "Hello!&lt;br&gt; How are you?";
  
      message.Body = body;
  
      SmtpClient smtpClient = new SmtpClient();
      smtpClient.Host = "relay-hosting.secureserver.net";
      smtpClient.Port = 465;
      smtpClient.EnableSsl = false;
      smtpClient.UseDefaultCredentials = false;
      smtpClient.Credentials = new NetworkCredential("mailadress@server.net", "Password");
     // AdvancedIntellect.Ssl.SslSocket ssl = new AdvancedIntellect.Ssl.SslSocket();
      smtpClient.Send(message);
      smtpClient.Timeout = 10000;
      }
      catch (Exception ex)
      {
          label2.Text = ex.Message;
      }
  }
  
  }
  </code></pre>
  
  <p>But I got error </p>
  
  <blockquote>
    <p>System.Net.Mail.SmtpException: Failure sending mail. --->
    System.Net.WebException: Unable to connect to the remote server --->
    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 68.178.232.62:25 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, Int32 timeout,
    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, Int32 timeout) at
    System.Net.PooledStream.Activate(Object owningObject, Boolean async,
    Int32 timeout, GeneralAsyncDelegate asyncCallback) at
    System.Net.PooledStream.Activate(Object owningObject,
    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.SmtpTransport.GetConnection(ServicePoint servicePoint)
    at System.Net.Mail.SmtpClient.GetConnection() at
    System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner
    exception stack trace --- at
    System.Net.Mail.SmtpClient.Send(MailMessage message) at
    Form1.Mailing() in
    c:\inetpub\vhosts\pay2school.net\httpdocs\IPTest\Admin\Form1.aspx.cs:line
    139</p>
  </blockquote>
  
  <p>I am rely fade up with this error. :( 
  I was change my SMTP server with smtpout.secureserver.net but not work.
  Please help me out. Thanks in advance.</p>