Saving a Message in the Inbox
To store a message in the Inbox without any recipients
-
Call IMsgStore::GetReceiveFolder to retrieve the entry identifier of the Inbox.
-
Call IMsgStore::OpenEntry to open the Inbox and retrieve a pointer to it.
-
Call the Inbox's IMAPIFolder::CreateMessage method to create the message.
-
Call the message's IMAPIProp::SetProps method to add the PR_BODY or PR_RTF_COMPRESSED and PR_SUBJECTproperties.
-
Create each attachment, set its properties, and save it. For detailed information about adding attachments to messages, see Creating a Message Attachment.
-
Call IMessage::SaveChanges to save the message. At this point it will appear in the contents table of the Inbox.
If you want to save a message intermittantly before having it appear in the contents table of the Inbox, create it instead in a hidden folder such as the root folder of the IPM subtree and then move it to the Inbox.