SaveMessage Method


Saves content of RawBody property into the file.

The file will contain RFC822 formatted message, so you can, for example, pass this file to SMTP.RelayMessage method.


blnResult = ObjectName.SaveMessage(FilePath)  
Parameters:  
FilePath As String Absolute or relative path where to save file containing message source  
Return value As Boolean True if successful, False if error has occurred  

Usage example:

Dim Mailer, Msg
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword"
If Mailer.Connected Then
   If Mailer.MessageCount > 0 Then
      Set Msg = Mailer.RetrieveSingleMessage(1)
      If Not Msg Is Nothing Then
        Msg.SaveMessage "C:\Docs\msg.eml"
      End If 
   End If
   Mailer.Disconnect
End If

See Also:

Message Object
RawBody Property
SMTP.RelayMessage Method


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