Share via


Accessing Messages in the MTS-IN and MTS-OUT Folders

Accessing Messages in the MTS-IN and MTS-OUT Folders

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

To put incoming messages into the MTS-IN folder, you must call the MAPI methods in the following table:

Method Description
IMAPIFolder::CreateMessage Creates a new MAPI message to hold the data from the incoming message.
IMessage::CreateAttach Holds any attachments on the incoming message.
IMAPIProp::OpenProperty Opens various message properties that your gateway will need to modify.
IMAPIProp::SetProps Modifies one or more property values.
IMessage::ModifyRecipients Modifies the recipient list on the new MAPI message.
IMAPIProp::SaveChanges Makes the above changes permanent in the new message.
IMessage::SubmitMessage Saves the message to the folder and marks it as ready to be delivered.

To read outgoing messages from the MTS-OUT folder, you must call the IMAPIFolder::GetContentsTable. This allows you to access the table of messages (MTEs) in the folder. After you have accessed this table, use the following methods:

Method Description
IMAPITable::QueryRows Retrieves one or more rows from the table.
Note  You can also use the HrQueryAllRows method of Microsoft® Exchange 2000 Server.
IMAPIContainer::OpenEntry Accesses a particular message transfer envelope (MTE) in the folder.
IMessage::GetRecipientTable Retrieves the addresses the message attached to the MTE should be delivered to.
IMessage::GetAttachmentTable Finds the message attached to the MTE.
IMAPIProp::GetProps Reads the subject, message class, contents, and other properties of the outgoing message.

For details about these functions, see the MAPI Programmer's Reference Online link. For examples of calling these functions, see the sample code for GWSAMPLE.CPP in the \E2K SGW\GWSAMPLE directory.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.