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
Open the default message store. For more information, see Opening a Message Store and Opening the Default Message Store.
Open the Outbox folder. For more information, see Opening a Message Store Folder.
Call the Outbox folder's IMAPIFolder::CreateMessage method to create the new message. For more information, see IMAPIFolder::CreateMessage,
Create a recipient list with one or more resolved recipients. For more information, see Creating a Recipient List.
Optionally, add a subject. For more information, see Creating a Message Subject.
Add the message text. For more information, see Creating Message Text.
If the message text is formatted, add rendering information. For more information, see Adding Rendering Information to Formatted Text.
Optionally, add one or more attachments. For more information, see Creating a Message Attachment.
Set other message properties as desired and then save and send the message by calling IMessage::SubmitMessage. For more information, see IMessage::SubmitMessage.
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
Creating a Recipient List
Describes how to create a recipient list.Creating a Message Subject
Describes how to create an optional subject for a message.Creating Message Text
Describes how to create message text.Adding Rendering Information to Formatted Text
Describes where in formatted text an attachment is to be rendered.Creating a Message Attachment
Describes how to create attachments.Saving a Message
Describes how clients save messages.Sending a Message
Describes how to send a message.Processing a Sent Message
Describes how to sent messages can be processed.