using System.Web.Mail;
MailMessage oMsg = new MailMessage();
oMsg.From = "mailbox@yourdomain.name";
oMsg.To = "riteshliet@yahoo.com";
oMsg.Subject = "Send Using Web Mail";
oMsg.BodyFormat = MailFormat.Html;
oMsg.Body = "Hello World!";
oMsg.Priority = MailPriority.High;
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "vijaypsd@moderndentalcentre.com");
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "vmodern");
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
SmtpMail.SmtpServer = "smtp.gmail.com";
SmtpMail.Send(oMsg);
oMsg = null;
No comments:
Post a Comment