How to send HTML mail in ASP.NET

Platform: ASP.NET| Category: Mail

VB.NET


Dim mail As New MailMessage()
mail.To = 'manag@syncfusion.com'
mail.From = 'admin@syncfusion.com'
mail.Subject = 'Test.'
mail.BodyFormat = MailFormat.Html
mail.Body = 'Test Message'
SmtpMail.SmtpServer = 'localhost' ’your real server goes here
SmtpMail.Send(mail)

C#


MailMessage mail = new MailMessage();
mail.To = 'manag@syncfusion.com';
mail.From = 'admin@syncfusion.com';
mail.Subject = 'Test.';
mail.BodyFormat = MailFormat.Html;
mail.Body = 'Test Message';
SmtpMail.SmtpServer = 'localhost';  //your real server goes here
SmtpMail.Send( mail );

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.