Namespace used :
using System.Net.Mail;
using System.Net;
Code in C#.Net :
public void sendMail()
{
MailMessage objMail = new MailMessage();
objMail.To.Add(new MailAddress("toaddress"));
objMail.From = new MailAddress("fromaddress", "dispalyname");
objMail.Subject = "mailSubject";
objMail.CC.Add("Ccmailaddress");
objMail.Bcc.Add("Bccmailaddress");
objMail.IsBodyHtml = true;
objMail.Priority=MailPriority.High;
objMail.Body = "mailContent";
SmtpClient objSmtp = new SmtpClient("relay-hosting.secureserver.net");
objSmtp.Credentials=CredentialCache.DefaultNetworkCredentials;
objSmtp.DeliveryMethod=SmtpDeliveryMethod.Network;
objSmtp.Send(objMail);
}
Wednesday, June 3, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment