BodyText Property

Contains the message's body.

If the message is multipart (i.e. constists of several parts, like attachments, alternative body presentation and so on), BodyText property includes richest text body. If the message includes HTML-formatted body, BodyText contains HTML body (plain version is still available through AltBodyText property). If only plain text body is available, BodyText contains plain body. Other parts of the message are available through Message.Attachments collection.

When composing the message (for using with SMTP object), consider using ImportBodyText method to import the body from a file, or ToUTF8 method to export Unicode content.

Value Type: String
Parameters: None 

Usage example:

Dim Mailer, Msg
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.Connect "", 110, "MyName", "MyPassword"
If Mailer.Connected Then
   If Mailer.MessageCount > 0 Then
      Set Msg = Mailer.RetrieveSingleMessage(1)
      If Not Msg Is Nothing Then MsgBox "Body = " & Msg.BodyText
   End If
End If

See Also:

"Displaying HTML-formatted messages in Visual Basic" Tutorial
"Displaying HTML-formatted messages in ASP" Tutorial
"Creating and sending HTML-formatted messages" Tutorial

Message Object
AltBodyText Property
ImportBodyText Method
ToUTF8 Method
GetBodyWithEmbeddedObjects Method
GetBodyWithEmbeddedObjectsEx Method

Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.