Mail.HtmlBody Property


Gets the html body of the e-mail message.

[VisualĀ Basic]
Public Property Get HtmlBody() As String
[Visual C++]
public: get_HtmlBody(BSTR* pVal);

Property Value

A String value indicating the html body of the e-mail message.

Remarks

If the email doesn't have a html body part, HtmlBody returns a html body converted from text body part; If the email doesn't have a text body part, TextBody returns a text body converted from html body.

Example

[VBScript]
Dim oMail
Set oMail = CreateObject("EAGetMailObj.Mail")
oMail.LicenseCode = "TryIt"

oMail.LoadFile "c:\\test.eml", False

WScript.Echo( "text body:" ) 
WScript.Echo( oMail.TextBody )
WScript.Echo( "html body:" )
WScript.Echo( oMail.HtmlBody )


/*if the test.eml has both text and html part,

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 text body

------=MailPart0000_0010_044A2F14
Content-Type: text/html;
        charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html><body>this is a html body</body></html>

------=MailPart0000_0010_044A2F14--


then output

text body:
this is a text body

html body:
<html><body>this is a html body</body></html>


if the test.eml has only text part,

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

then output

text body:
test body

html body:
test body<br>

if the test.eml has only html part,
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 html body</body></html>


then output

text body:
this is a html body

html body:
<html><body>this is a html body</body></html>
*/