GetBodyWithEmbeddedObjectsEx Method
Visual
Basic Tutorial available! (3 pages)
ASP Tutorial available! (4 pages)
Prepares HTML-formatted messages for displaying, also saving embedded objects
of the message into default or user-specified temporary location.
GetBodyWithEmbeddedObjectsEx 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.
This method by default also removes META charset information from the HTML message body. See RemoveCharsetFromBody method documentation on why this is useful.
The method returns prepared message body text. Original value of BodyText
property is not affected.
strPreparedBody = ObjectName.GetBodyWithEmbeddedObjectsEx([TempDirectoryPath], [VirtualPath], [MessageDirectoryName], [PathBuildingMode], [Options], [Filter]) |
Parameters: | ||
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 | |
VirtualPath As String | (optional) Virtual path to the physical location of TempDirectoryPath, or downloader URL (see PathBuildingMode parameter). If not specified, defaults to TempDirectoryPath | |
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 | |
PathBuildingMode As Long | (optional) Specifies the method of
creating and translating physical file paths of the attachments into URLs
that substitute CIDs in HTML tags. Options supported:
|
|
Options As Long | (optional) If 0, META chatset information will be removed from HTML source. If 1, this tag will be left intact. The default is 0 (remove META charset). | |
Filter as Object | (optional) Reserved for future use. Must be set to Nothing. | |
Return value As String | If successful, the result is a prepared body text. Otherwise, zero-length string is returned |
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 "mailserver.com", 110, "MyName", "MyPassword" If Mailer.Connected Then If Mailer.MessageCount > 0 Then Set Msg = Mailer.RetrieveSingleMessage(1) MsgBox Msg.GetBodyWithEmbeddedObjectsEx(, , , 4, , ) ' Hybrid PathBuildingMode End If Mailer.Disconnect End If
See Also:
"Displaying
HTML-formatted messages in Visual Basic" Tutorial
"Displaying HTML-formatted messages
in ASP" Tutorial
GetBodyWithEmbeddedObjects
Method
RemoveMessageDirectory
Method
GetMessageDirectoryPath
Method
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.