Venkat S

Venkat S

  • 1.5k
  • 234
  • 203.1k

How to send mail using web.mail name space

Oct 12 2011 8:08 AM
hi Friends


i try this code but not able to get mail

please through this send me u r valuable thoughts



MailMessage mailMessage=new MailMessage();
  mailMessage.From = "[email protected]";
  mailMessage.To="[email protected]";
 
  mailMessage.Cc = "[email protected]";
  mailMessage.Bcc = "[email protected]";
  mailMessage.Subject = "this test mail";
  mailMessage.BodyFormat = MailFormat.Text;
  mailMessage.Body = "sample mail";
 
  mailMessage.Priority = MailPriority.Normal;
  SmtpMail.SmtpServer = "mail.ajel.com";

  SmtpMail.Send(mailMessage);
  lblValidate.Visible = true;
  lblValidate.Text = "successfully subscribed.";

Answers (3)