GetMessageDirectoryPath Method


Visual Basic Tutorial available! (3 pages)

ASP Tutorial available! (4 pages)

Returns the path to the message directory previously created by GetBodyWithEmbeddedObjectsEx or GetBodyWithEmbeddedObjects method call.

This method is useful if the Message object is destroyed before its corresponding message directory becomes removed (this behavior is common in web environment where all objects are removed as soon as the page has been processed).

The value returned by this method should be stored somewhere (for example, in the Session for ASP or global variable for Visual Basic). Then (when the message directory becomes no longer needed) pass it to RemoveMessageDirectory method as a value of MessageDirectoryPath parameter.

Note: The message directory path may be empty string even if GetBodyWithEmbeddedObjectsEx or GetBodyWithEmbeddedObjects method has been already called. This just means the message had no embedded objects and there was no need to save any files and create the message directory.


strPath = ObjectName.GetMessageDirectoryPath  
Parameters: None 
Return value As String The path to the message directory  

Usage example:

' VB-only sample (see ASP tutorial for ASP samples)
Dim MsgDirPath

Sub Form_Load()
  Dim Mailer, Msg

  Set Mailer = CreateObject("MailBee.POP3")
  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)
      MsgBox Msg.GetBodyWithEmbeddedObjects(, , )
      MsgDirPath = Msg.GetMessageDirectoryPath
    End If
    Mailer.Disconnect
  End If
End Sub

Sub Form_Unload(Cancel As Integer)
  Dim Msg

  Set Msg = CreateObject("MailBee.Message")
  Msg.RemoveMessageDirectory MsgDirPath
End Sub

See Also:

"Displaying HTML-formatted messages in Visual Basic" Tutorial
"Displaying HTML-formatted messages in ASP" Tutorial

GetBodyWithEmbeddedObjects Method
GetBodyWithEmbeddedObjectsEx Method
RemoveMessageDirectory Method


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