RelayMessage Method


Relays (forwards) previously saved message to one or more recipients.

The message file must be in RFC822 format (Message.SaveMessage method produces such files, and many other mail programs also understand this format).


blnResult = ObjectName.RelayMessage(FilePath, FromAddr, Recips)  
Parameters:  
FilePath As String Path to the RFC822-formatted file to send  
FromAddr As String E-mail address of the sender. This value can differ from the value of the "From" header in the message itself  
Recips As String comma-separated list of recipients' email addresses. This value can differ from the value of the "To", "CC" headers in the message itself  
Return value As Boolean True if successful, False otherwise  

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.EnableLogging = True
Mailer.LogFilePath = "C:\my_log.txt"
Mailer.ClearLog
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mailserver.com"
If Mailer.Connect Then
  Mailer.RelayMessage "C:\Docs\msg.eml", "alex@myhost.com","joe@hishost.com,jane@hershost.com"
  Mailer.Disconnect
Else
  MsgBox Mailer.ErrDesc
End If

See Also:

Connect Method
Send Method


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