Monday, 27 May 2013

mail Send in asp.net


mail Send in asp.net 


C#:

//NameSpace Add
     using System.Web.Mail;

 Send Mail:

        MailMessage mail = new MailMessage();
  //mail From
        mail.From = "noreplay@vijubook.com";
  //mail To
        mail.To = "123@gmail.com";
  // Subject
        mail.Subject = "Test Mail Send Subject";
  // Body
          mail.Body = "Test Mail Send Body";
   //  Format For mail
        mail.BodyFormat = MailFormat.Html;
   // Server Name
        SmtpMail.SmtpServer = "123.123.net";
     //Send
        SmtpMail.Send(mail);

        Response.Write("Mail Send");


No comments:

Post a Comment