Platform SDK: SMTP Server Events

IMailMsgProperties::CopyContentToFile

[This is preliminary documentation and subject to change.]

Copy the entire content to a specified file with optional asynchronous completion.

[local] HRESULT CopyContentToFile(
  [in] PFIO_CONTEXT pFIOCopy,
  [in,unique] IMailMsgNotify *pNotify
);
pFIOCopy
Specifies the previously opened file into which to copy the contents. The file handle within the FIO_CONTEXT must have been opened with the FILE_FLAG_OVERLAPPED flag and associated with an FIO_CONTEXT structure using the AssociateFile function.
pNotify
Interface to notify for asynchronous completion. If this value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).

Return Values

Value Description
S_OK Success. The method completed synchronously.
MAILMSG_S_PENDING Success. The operation will complete asynchronously. When it completes, you will be notified through the interface you passed using the pNotify parameter. The result of the operation will be returned with the notification callback method.

Remarks

You supply the I/O handle used to write the content within the FIO_CONTEXT structure. This handle must have been created using the FILE_FLAG_OVERLAPPED flag and associated with an FIO_CONTEXT structure using the AssociateFile function. The HANDLE value within the FIO_CONTEXT structure need not be a file on the file system, but can be any I/O handle that supports asynchronous I/O (overlapped) operations.

This method is marked with the [local] IDL attribute. This means no proxy/stub code is generated for the header file, and the method can only be called on an interface in the same apartment (i.e. no marshalling can occur).

See Also

IMailMsgNotify, IMailMsgNotify::Notify, AssociateFile