3
Reply

How to send mail using web.mail name space

Venkat S

Venkat S

Oct 12 2011 8:08 AM
1.4k
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)