ImportBodyText Method
Sets value of BodyText property by importing
contents of specified file. HTML import option is also available.
In HTML Import mode the following considerations are used while scanning tags
of specified html file:
blnResult = ObjectName.ImportBodyText(FilePath, [HTMLImport], [AppendMode]) |
Parameters: | ||
FilePath As String | The path to the file containing body text | |
HTMLImport As Boolean | (optional) If True, HTML import mode is active. In this mode MailBee scans specified file for embedded objects, images, etc. and adds them as inline attachments to the message. If False, plain text import is assumed. Default value is False | |
AppendMode As Boolean | (optional) If True, BodyText value is not overwritten by this method, but extended with value generated by ImportBodyText method. Default is False | |
Charset As String | (optional) The charset of the file being imported. If not specified, MailBee will assume the system default encoding to set the charset. In case of HTML import, however, MailBee by default detects the charset from the META charset tag specified in the HTML source itself. | |
CharsetOptions As Long |
(optional) A set of flags (some of which can be combined together) which affect how the charset of the HTML file being imported will be determined: - META charset tag is removed from the HTML source |
|
Return value As Boolean | True if successful. False if error has occurred (file not found, i/o error, etc.) |
Usage example:
Dim Mailer 'Using visual basic to create object Set Mailer = CreateObject("MailBee.SMTP") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.SMTP") 'In ASP use Response.Write instead of MsgBox Mailer.LicenseKey = "put your license key here" Mailer.ServerName = "mail.server.com" If Mailer.Connect Then Mailer.Message.ToAddr = "bill@yoursite.com" Mailer.Message.FromAddr = "joe@mysite.com" Mailer.Message.Subject = "Hello" Mailer.Message.ImportBodyText "C:\docs\letter.htm", True Mailer.Send Mailer.Disconnect End If
See Also:
ImportAltBodyText
Method
BodyText Property
BodyFormat Property
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.