Send mail

Posted by Rajni.Shekhar under ASP.NET category on | Points: 40 | Views : 1285
Add System.Web.Mail namespace to use mail functionality

using System.Web.Mail;

MailMessage mail = new MailMessage();
SmtpMail.SmtpServer = ""; //ip of your smptp server is used for an example only, not an excatly ip. so change it by your ip
mail.To = txtemailid.Text;
mail.From = "";
mail.Subject = "Try mail sending using";
string MailBody = "We are trying to send mail using smtp server ..................";
mail.Body = MailBody;

Comments or Responses

Login to post response