Here is the code to send email via C sharp application. It can be applied on desktop or web application.
Use it wisely.
private void SendEmail(string sendTo, string from)
{
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress(from);
mailMessage.IsBodyHtml = true;
mailMessage.To.Add(sendTo);
mailMessage.CC.Add("vrey@binus.edu");
mailMessage.Subject = "Subject";
mailMessage.Body = "Content in HTML format";
SmtpClient smtpClient = new SmtpClient(smtpclient);
smtpClient.Port = 25;
smtpClient.Send(mailMessage);
}
|
This entry was posted on Tuesday, May 25, 2010 and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
0 comments: