|
BOOL SetExportOptions( |
|
DWORD dwOptions |
|
); |
The SetExportOptions method specifies a bitmask that
describes current message export options.
Parameters
- dwOptions
- Mask of attribute options. The mask is a combination of the
following values:
Constant |
Description |
MIME_OPTION_DEFAULT |
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. |
MIME_OPTION_KEEPORDER |
The original order in which the message header fields were
set or imported are preserved when the message is
exported. |
MIME_OPTION_ALLHEADERS |
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. |
MIME_OPTION_NOHEADERS |
When exporting a message, the main header block will not
be included. This can be useful when creating a multipart
message for services which expect MIME formatted data, such
as HTTP POST requests. This option should never be used for
email messages being submitted using SMTP. |
Return Value
If the method succeeds, the return value is non-zero. If the
method fails, the return value is zero. To get extended error
information, call GetLastError.
Remarks
By default, the Received and Return-Path headers are not exported.
In addition, the order of the headers in an exported message is
undefined. This is reasonable behavior for most mail clients, but may
not be appropriate for applications which need access to all of the
header fields.
Example
pMessage->SetExportOptions(MIME_EXPORT_OPTIONS_ALL |
MIME_EXPORT_OPTIONS_KEEP_ORDER);
if (pMessage->Import(lpszFileName))
{
// Process the message and make any modifications
// then write the message back out, preserving all
// of the headers in their original order
bResult = pMessage->Export(lpszFileName);
}
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csmsgv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
ExportMessage,
ImportMessage,
GetExportOptions
|
|