Gets or sets the html body of the e-mail message.
[Visual Basic] Public Property HtmlBody As String
[C#] public string HtmlBody {get; set;}
[C++] public: __property String^ get_HtmlBody(); public: __property void set_HtmlBody(String^);
[JScript] public function get HtmlBody() : String; public function set HtmlBody(String);
Property Value
Remarks
Example
[Visual Basic, C#] To get the full samples of EASendMail, please refer to Samples section.
[C#] SmtpMail oMail = new SmtpMail("TryIt"); oMail.HtmlBody = "<html><body>this is a test</body></html>"; oMail.TextBody = ""; Console.WriteLine(System.Text.Encoding.ASCII.GetString(oMail.EncodedContent)); //Output /* From: <> Subject: (Trial Version) Date: Thu, 23 Mar 2006 15:04:18 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=MailPart0000_0010_044A2F14" This is a multi-part message in MIME format. ------=MailPart0000_0010_044A2F14 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable this is a test ------=MailPart0000_0010_044A2F14 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html><body>this is a test</body></html> ------=MailPart0000_0010_044A2F14-- */ oMail.HtmlBody = "<html><body>this is a test</body></html>"; oMail.TextBody = "plain body text"; Console.WriteLine(System.Text.Encoding.ASCII.GetString(oMail.EncodedContent)); //Output /* From: <> Subject: (Trial Version) Date: Thu, 23 Mar 2006 15:04:18 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=MailPart0000_0010_044A2F14" This is a multi-part message in MIME format. ------=MailPart0000_0010_044A2F14 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable plain body text ------=MailPart0000_0010_044A2F14 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html><body>this is a test</body></html> ------=MailPart0000_0010_044A2F14-- */ oMail.TextBody = "test body"; oMail.HtmlBody = ""; Console.WriteLine(System.Text.Encoding.ASCII.GetString(oMail.EncodedContent)); //Output /* From: <> Subject: (Trial Version) Date: Thu, 23 Mar 2006 15:04:18 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable test body */ oMail.HtmlBody = "<html><body>this is a test</body></html>"; oMail.TextBody = ""; oMail.AutoTextBody = false; Console.WriteLine( System.Text.Encoding.ASCII.GetString(oMail.EncodedContent)); //Output /* From: <> Subject: (Trial Version) Date: Thu, 23 Mar 2006 15:04:18 +0800 MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html><body>this is a test</body></html> */
See Also
SmtpMail.AutoTextBody Property
SmtpMail.TextBody Property
SmtpMail.ImportHtml Method
SmtpMail.ImportHtmlBody Method
Online Examples
C# - Send Email with Inline Images
VB - Send Email with Inline Images
C++/CLI - Send Email with Inline Images
Online Tutorials
Send
Email in C# - Tutorial
Send
Email in VB - Tutorial
Send Email in Managed C++/CLI - Tutorial