ImportAltBodyText Method


Sets value of AltBodyText property by importing contents of specified file.

This method is useful if alternative (plain-text) presentation for html-formatted body is available in a file.


blnResult = ObjectName.ImportAltBodyText(FilePath, [AppendMode])  
Parameters:  
FilePath As String The path to the file containing alternative plain-text body  
AppendMode As Boolean (optional) If True, AltBodyText value is not overwritten by this method, but extended with value generated by ImportAltBodyText 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 determine the charset of the file.  
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.ImportAltBodyText "C:\docs\letter.txt", True
  Mailer.Message.ImportBodyText "C:\docs\letter.htm", True
  Mailer.Send
  Mailer.Disconnect
End If

See Also:

ImportBodyText Method
AltBodyText Property


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