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