Posting a Message

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Posting a message is similar to sending a message. The main difference is the destination. Rather than being directed to one or more recipients across one or more messaging systems, a posted message remains in a folder in the current message store.

To post a message

  1. Open the destination folder by calling IMsgStore::OpenEntry. If the destination folder is the Inbox, locate the entry identifier to pass to OpenEntry by calling IMsgStore::GetReceiveFolder.

  2. Call IMAPIFolder::CreateMessage to create the message.

  3. Call the message's IMAPIProp::SetProps method to set:

  4. Call the message's IMAPIProp::SaveChanges method to save the message.

  5. If necessary, create an attachment, set its properties, and save it. For more information about adding attachments to messages, see Creating a Message Attachment.

  6. Call IMessage::SaveChanges to save the message. At this point it will appear in the contents table of the destination folder.

Notice that you do not create a recipient list. Instead, you set several properties that are normally set by a transport provider for a sent message.

If you want to save a message intermittently before having it appear in the contents table of the visible folder, create it instead in a hidden folder such as the root folder of the IPM subtree and then move it to the target folder.