To compose a message, a client application either creates a new message, forwards an existing message, or replies to an existing message. The new message can contain new material. Replying to existing messages involves creating a new message and copying the contents of the original message to it. All new messages can specify a return receipt as well.
To send a message
Create a MapiMessage structure to contain the message.
Create one or more MapiRecipDesc structures describing the recipients of the message and place them in the lpRecips member of the MapiMessage structure.
Create a text string containing the subject, if any, and place it in the lpszSubject member of the MapiMessage structure.
Create a text string containing the message text, if any, and place it in the lpszNoteText member of the MapiMessage structure.
Create an array of MapiFileDesc structures, if necessary, to contain any attachments and place it in the lpFiles member of the MapiMessage structure.
Submit the message by calling the MAPISendMail function.
Sending messages can involve more or less effort on the part of your client, depending on the way you invoke various Simple MAPI functions to perform the above steps. For more information, see Controlled Sending of a Message: Simple MAPI Sample.
When your client submits a message to MAPISendMail, it has the option of requesting a return receipt. Return receipts are automatically generated messages that senders receive to inform them that messages they sent, for which a return receipt was requested, were delivered successfully to the recipient. To request a return receipt, include the MAPI_RECEIPT_REQUESTED flag in the flFlags member of the MapiMessage structure:
// MapiMessage mymessage; declared and initialized elsewhere.
mymessage.flFlags |= MAPI_RECEIPT_REQUESTED;