Regex.Replace(htmlString, @"<[^>]*>", String.Empty)
A place where Web Developer can get awesome articles in asp.net, windows phone 7 / 8 application codes. We aimed at providing the maximum help in the Software Development and Design :)
Thursday, August 29, 2013
Send Mail using Gmail Host in asp.net
/* Code to Send Mail using Gmail Host Server Settings in asp.net */
var fromAddress = new MailAddress("FromAddress@abc.com", "Display Name");
var fromAddress = new MailAddress("FromAddress@abc.com", "Display Name");
var toAddress = new MailAddress("ToAddress@abc.com", "Display Name");
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromAddress.Address, "GmailPassword")
};
var message = new MailMessage(fromAddress, toAddress)
{
Subject = "MailSubject",
Body = "Mail Body",
IsBodyHtml = true
};
smtp.Send(message);
Subscribe to:
Posts (Atom)