Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Using these Code How to check Code where is error Exist I Am Not Found Out Please Help Me.
C#
class
{
public string TO { get; set; }
    public string SUBJECT { get; set; }
    public string BODY { get; set; }
    public void sendmail()
    {
        MailMessage msg = new MailMessage();
        msg.From = new MailAddress(FROM);
        msg.To.Add(TO);
        msg.Subject = SUBJECT;
        msg.Body = BODY;
        msg.IsBodyHtml = true;
        SmtpClient client = new SmtpClient();
        client.Host = "smtp.gmail.com";
        client.EnableSsl = true;
        client.Credentials = new NetworkCredential();
     //   client.UseDefaultCredentials = true;
        client.Port = 587;
        client.Send(msg);
    }
}
Posted
Updated 23-Dec-15 23:21pm
v3
Comments
Raje_ 24-Dec-15 4:34am    
What error you are getting?
Member 11148901 24-Dec-15 4:58am    
I Am Not Getting Any Error
Thanks7872 24-Dec-15 5:20am    
Then what is the question?
Member 11148901 24-Dec-15 5:26am    
I Am Already Used Step But Not solve My Problem
Gokulprasad05 24-Dec-15 5:24am    
http://allittechnologies.blogspot.in/2015/04/how-to-send-user-confirmation-email-after-registration-in-asp-net-csharp-codeing.html

This Link is useful to you

1 solution

Check my past answer for a full solution - sending email to gmail from asp.net[^].

See what you are missing in code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900