Sending mail from c#.net
<p>I wrote this code in c# to send email to perticular userid
it was working fine from local host</p>

<p>But today I hosted in server
but after hosting email was not sent
"messaging sending failed" - This error is displaying
This is code I written</p>

<p>Please give any sugession</p>

<pre><code>string msg = "Welcome to India";
MailMessage mm = new MailMessage("email_from@gmail.com", email_to@gmail.com, "subject", msg);

mm.IsBodyHtml = false;
SmtpClient sc = new SmtpClient("smtp.gmail.com",587);
NetworkCredential nc = new NetworkCredential("email_from@gmail.com", "password");
sc.EnableSsl = true;
sc.UseDefaultCredentials = false;
sc.Credentials = nc;
sc.Send(mm);
</code></pre>
