Monthly Archives: July 2012

Send E-mail using ASP.Net

Send e-mail using c# in ASP.Net.


first Import the below namespace in your web application.

  • using System.Net.Mail; 

Code for Send email using ASP.Net

MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress(“meera@academy.com”, YourName);message.From = fromAddress;

message.To.Add(“info@academy.com”);  message.Subject = “Meera Academy – Information”;
message.IsBodyHtml = false;
message.Body = “Your Message”;

SmtpClient sc = new SmtpClient();

sc.Host = “smtp.gmail.com”;                           
sc.Port = 587;
sc.Credentials = new System.Net.NetworkCredential(“demo@gmail.com”, “gmailpassword”);

read more