Sending mail through Asp.net
Sending mail through Asp.net
Example of Sending mail through Asp.net
Import Namespace using System.Web.Mail;
//Create a object on MailMessage
MailMessage objMailMessage = new MailMessage();
//Mention the TO Address
objMailMessage.To = "mail1@gmail.com";
//Mention the From Address
objMailMessage.From = "mail2@gmail.com";
//Subject of the mail
objMailMessage.Subject = "Hi";
//Body of the mail
objMailMessage.Body = "Hello how are u ,Thank u";
//mail format
objMailMessage.BodyFormat = MailFormat.Html;
//SmtpMail.SmtpServer = "206.190.60.37";
SmtpMail.Send(objMailMessage);