Code to send Email from C# Code

Code to send Email from C# Code
MailMessage msg = new MailMessage();
msg.From = new MailAddress(mailFrom);
msg.Subject = mailSubject;
msg.Body = mailBody;
msg.IsBodyHtml = true;
//msg.Attachments.Add(new Attachment(mailAttachment));
SmtpClient smtpclient = new SmtpClient();
NetworkCredential nc = new NetworkCredential("GMail Email ID", "GMail Password");
smtpclient.Credentials = nc;
smtpclient.EnableSsl = true;
smtpclient.Host = "";
smtpclient.Port = 587;

Search This Blog

Link Within Related Posts Plugin for WordPress, Blogger...