RemoveMessageDirectory Method
Visual
Basic Tutorial available! (3 pages)
ASP Tutorial available! (4 pages)
Destroys the message temporary directory (with all its contents) previously
created by GetBodyWithEmbeddedObjectsEx or GetBodyWithEmbeddedObjects
method call.
Message object internally stores the path to the message directory created
by GetBodyWithEmbeddedObjects or GetBodyWithEmbeddedObjectsEx
methods. However, when the Message object is freed, this information is lost.
If you're going to destroy the message temporary directory during lifetime of
the Message object, you may call RemoveMessageDirectory method
without parameters.
Another approach (useful for web environments where objects are created and
destroyed each time the user makes request to the server) is to obtain the message
directory path through the call of GetMessageDirectoryPath method and
save returned value for later use. You must call GetMessageDirectoryPath
method AFTER calling GetBodyWithEmbeddedObjects or GetBodyWithEmbeddedObjectsEx
methods. When the time to clean up comes, call RemoveMessageDirectory
method using previously stored value as MessageDirectoryPath parameter.
If MessageDirectoryPath parameter is omitted, the method will destroy
the temporary message directory ONLY IF GetBodyWithEmbeddedObjectsEx
or GetBodyWithEmbeddedObjects method has been already called for the
same instance of the Message object.
blnResult = ObjectName.RemoveMessageDirectory([MessageDirectoryPath], [DeleteContentOnly]) |
Parameters: | ||
MessageDirectoryPath As String | (optional) The path to the temporary message directory created by MailBee for the message. If omitted, the path is taken from internal variable that is set by GetBodyWithEmbeddedObjects or GetBodyWithEmbeddedObjectsEx methods | |
DeleteContentOnly As Boolean | (optional) If True, the method will remove all files from the message directory, but the directory itself will NOT be deleted. Default is False | |
Return value As Boolean | True if successful, False if error occurred (the path doesn't exist, some files are locked, etc.) |
Usage example:
' VB-only sample (see ASP Tutorial for ASP samples) 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(, , ) ' Clean up once the user has finished viewing the message Msg.RemoveMessageDirectory End If Mailer.Disconnect End If
See Also:
"Displaying
HTML-formatted messages in Visual Basic" Tutorial
"Displaying HTML-formatted messages
in ASP" Tutorial
GetBodyWithEmbeddedObjects
Method
GetBodyWithEmbeddedObjectsEx
Method
GetMessageDirectoryPath
Method
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.