ASP.Net Unable to send Email
<p>I am trying to use the below code to send email from asp.net(C#).</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using MovieReviews.Utils;

/// &lt;summary&gt;
/// Summary description for EmailUtil
/// &lt;/summary&gt;
public class EmailUtil
{
public static void SendEmail(string to, string name, string from, string body)
{
    try
    {
        SmtpClient smtpClient = new SmtpClient();
        MailMessage message = new MailMessage();

        MailAddress fromAddress = new MailAddress(from, name);

        smtpClient.Host = "localhost";

        //Default port will be 25

        smtpClient.Port = 25;

        //From address will be given as a MailAddress Object

        message.From = fromAddress;

        // To address collection of MailAddress

        message.To.Add(to);
        message.Subject = "Feedback";


        message.IsBodyHtml = false;

        // Message body content

        message.Body = body;

        // Send SMTP mail

        smtpClient.Send(message);

    }
    catch (Exception ex)
    {
        Logger.LogError(ex);
        throw ex;
    }

}
}  
</code></pre>

<p>When I try to execute it says </p>

<blockquote>
  <p>An attempt was made to access a socket in a way forbidden by its
  access permissions 127.0.0.1:25</p>
</blockquote>

<p>Please suggest me what should i do. I tried turning off the firewall as per some answers in the forums, but no luck.</p>

<p>Thank you in advance</p>
