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:

Also, if HTML Import mode is active, the method sets BodyFormat=1 (HTML Format).


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  
Return value As Boolean True if successful. False if error has occurred (file not found, i/o error, etc.)  
Remarks: If the message was received using MailBee.POP3 object, this method will do nothing unless Message.Locked property is set to False

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-2008, AfterLogic Corporation. All rights reserved.