GetBodyWithEmbeddedObjects Method

Visual Basic Tutorial available! (3 pages)

Prepares HTML-formatted messages for displaying them locally, also saving embedded objects of the message into default or user-specified temporary location.

Note: It's recommended to use GetBodyWithEmbeddedObjectsEx method instead. It's more flexible and accurate.

GetBodyWithEmbeddedObjects method processes the message body (taken from BodyText property) replacing CIDs (Content-IDs) with corresponding attachments filenames and saving attachments required for displaying the message body (i.e. embedded objects) in specified directory. If the message body has non-HTML format, this stage is skipped.

The method returns prepared message body text. Original value of BodyText property is not affected.

As soon as message viewing is finished, call RemoveMessageDirectory method without parameters to remove temporary folder created by MailBee for displaying the message.

strPreparedBody = ObjectName.GetBodyWithEmbeddedObjects([TempDirectoryPath], [MessageDirectoryName], [Filter])  
TempDirectoryPath As String (optional) Path to the temporary directory where MailBee will create message directory for storing temporary files. If not specified, the current user's temporary directory will be used  
MessageDirectoryName As String (optional) The name of the message directory to be created within TempDirectoryPath where temporary files of the current message will be placed. If not specified, the name will be generated by MailBee as MD5 digest of Message-ID  
Filter as Object (optional) reserved for future use. Leave it Nothing  
Return value As String If successful, the result is a prepared body text. Otherwise, zero-length string is returned  

Usage example:

' VB-only sample (see ASP Tutorial for ASP samples)
Dim Mailer, Msg
Set Mailer = CreateObject("MailBee.POP3")
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)
      MsgBox Msg.GetBodyWithEmbeddedObjects(, , )
   End If
End If

See Also:

"Displaying HTML-formatted messages in Visual Basic" Tutorial
"Displaying HTML-formatted messages in ASP" Tutorial

GetBodyWithEmbeddedObjectsEx Method
RemoveMessageDirectory Method
GetMessageDirectoryPath Method

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