ASP Email sending error
<p>I have found this site very useful for all my previously faced problems, However i couldnt get help with the following.</p>

<p>I have developed a website which is able to send emails. On localhost this works absolutely fine. when i say localhost, i am able to recive the emails sent, but when i upload onto server i face this error when it starts the process of sending emails.</p>

<p>"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 IPADDRESS:PORT"</p>

<p>Tried ping on the adrress for the port and ping is working.</p>

<p>Here is the code</p>

<pre><code>string strFrm = ConfigurationManager.AppSettings["FromAddress3"].ToString();

string[] receive = {"emailaddress1","emailaddress2","emailaddress3","emailaddress4"};

string subject = "New registration";

string body = "&lt;html&gt;&lt;head&gt;&lt;title&gt;Registered Candidates&lt;/title&gt;&lt;/head&gt;&lt;body&gt;bla bla bla&lt;/body&gt;&lt;/html&gt;";

//I however have put reg exp validator on the form

if(txtEmail.Text.Contains("@") &amp;&amp; txtEmail.Text.Contains("."))
{
    for (int i = 0; i &lt;= receive.Length - 1; i++)
    {
        MailMessage msg = new MailMessage(strFrm, receive[i], subject, body);
        msg.IsBodyHtml = true;

        SmtpClient client = new SmtpClient();

        client.Send(msg);
     }

     Response.Redirect("Thankyou.html");
</code></pre>

<p>Web.config</p>

<pre><code>&lt;mailSettings&gt;
  &lt;smtp from="from address"&gt;
    &lt;network host="server" port="25"
userName="username" password="password"  /&gt;
  &lt;/smtp&gt;
&lt;/mailSettings&gt;
</code></pre>

<p>Please help. I upload onto my server via precompilation of the site and upload the files.</p>
