Compartir a través de


Handling an Outgoing Message

Applies to: Office 2010 | Outlook 2010 | Visual Studio

An outgoing message is a message that can be sent to one or more recipients across one or more messaging systems or be posted to a folder in a message store.

To create and send an outgoing message

  1. Open the default message store. For more information, see Opening a Message Store and Opening the Default Message Store.

  2. Open the Outbox folder. For more information, see Opening a Message Store Folder.

  3. Call the Outbox folder's IMAPIFolder::CreateMessage method to create the new message. For more information, see IMAPIFolder::CreateMessage,

  4. Create a recipient list with one or more resolved recipients. For more information, see Creating a Recipient List.

  5. Optionally, add a subject. For more information, see Creating a Message Subject.

  6. Add the message text. For more information, see Creating Message Text.

  7. If the message text is formatted, add rendering information. For more information, see Adding Rendering Information to Formatted Text.

  8. Optionally, add one or more attachments. For more information, see Creating a Message Attachment.

  9. Set other message properties as desired and then save and send the message by calling IMessage::SubmitMessage. For more information, see IMessage::SubmitMessage.

  10. Delete the sent message if the PR_DELETE_AFTER_SUBMIT (PidTagDeleteAfterSubmit) property is set to TRUE or move it to the folder identified by the PR_SENTMAIL_ENTRYID (PidTagSentMailEntryId) property. For more information, see Processing a Sent Message.

If you want to intermittantly save the message before sending it, call the message's IMAPIProp::SaveChanges method. For more information, see, Saving a Message or Sending a Message.

In This Section