How do I send a simple Html email? By default, email sent with System.Web.Mail is formatted as plain text. To format as Html, set the MailMessage.BodyFormat property to MailFormat.Html. [ C# ]
MailMessage mail = new MailMessage(); mail.To = "me@mycompany.com"; mail.From = "you@yourcompany.com"; mail.Subject = "this is a test email."; mail.BodyFormat = MailFormat.Html; mail.Body = "this is my test email body.<br><b>this part is in bold</b>"; SmtpMail.SmtpServer = "localhost"; //your real server goes here SmtpMail.Send( mail );
Dim mail As New MailMessage() mail.To = "me@mycompany.com" mail.From = "you@yourcompany.com" mail.Subject = "this is a test email." mail.BodyFormat = MailFormat.Html mail.Body = "this is my test email body.<br><b>this part is in bold</b>" SmtpMail.SmtpServer = "localhost" 'your real server goes here SmtpMail.Send(mail)
Copyright © 2004 Contact: Dave Wanta. aspNetEmail aspNetPOP3 aspNetMime