ExportMessage Method  
 

Export the current message to a file on the local system.

Syntax

object.ExportMessage( FileName, [Options] )

Parameters

FileName
A string which specifies the name of the file that will contain the message. If the file does not exist, it will be created. If it does exist, it will be overwritten with the contents of the message.
Options
An optional integer value which specifies one or more options. If this argument is omitted, the Options property value will be used as the default. The following values may be combined using a bitwise Or operator:
Value Description
mimeOptionDefault The default export options. The headers for the message are written out in a specific consistent order, with custom headers written to the end of the header block regardless of the order in which they were set or imported from another message. If the message contains Bcc, Received, Return-Path, Status or X400-Received header fields, they will not be exported.
mimeOptionAllHeaders All headers, including the Bcc, Received, Return-Path, Status and X400-Received header fields will be exported. Normally these headers are not exported because they are only used by the mail transport system. This option can be useful when exporting a message to be stored on the local system, but should not be used when exporting a message to be delivered to another user.
mimeOptionKeepOrder The original order in which the message header fields were set or imported are preserved when the message is exported.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

See Also

ImportMessage Method