Sent Property (Message Object)

Sent Property (Message Object)

The Sent property is True if the message has been sent through the MAPI system. Read/write.

Syntax

objMessage.Sent

Data Type

Boolean

Remarks

In general, there are three different kinds of messages: sent, posted, and saved. Sent messages are traditional e-mail messages sent to a recipient or public folder. Posted messages are created in a public folder. Saved messages are created and saved without either sending or posting.

For all three kinds of messages, you use the Sent, Submitted, and Unread properties and the Send or Update methods.

The following table summarizes the use of the message properties and methods for the three kinds of messages. In some systems the message store and transport providers are tightly coupled, in which case they bypass the spooler and perform its functions themselves.

Kind of message

Method used

Sent property

Submitted property

Unread property

Sent

Send

Spooler sets True

Send sets True

Spooler sets True

Posted

Update

Application sets True

Application sets False

Application sets True

Saved

Update

Application sets False

Application sets False

Application sets True

For sent messages, the Sent property can be written until the time you call the Send method. Note that changing the Sent property to True does not cause the message to be sent. Only the Send method actually causes the message to be transmitted. After you call Send, the messaging system controls the Sent property and changes it to a read-only property. The receiving messaging system resets the Submitted property to False when the message arrives in a recipient's Inbox.

A common use for writing a value to the Sent property is to set it to False so that an electronic mail system can save pending, unsent messages in an Outbox folder, or to save work-in-progress messages in a pending folder before committing the messages to a public information store. You can cause unexpected results if you set the property incorrectly.

For posted messages, you create the message directly within a public folder and call the Update method. Some viewers do not allow the message to become visible to other users until you set the Submitted property to True.

The Sent property is changed using the following sequence. When you call the Send method to send a message to a recipient, the message is moved to the Outbox and the Message objects Submitted property is set to True. When the messaging system actually starts transporting the message, the Sent property is set to True.

When the message is not sent using the Send method, the MAPI system does not change the Sent property. For posted messages that call the Update method, you should set the value of the Sent property to True just before you post the message.

For more information on sending and posting messages, see Creating and Sending a Message and Posting Messages to a Public Folder.

The Sent property is not exposed on AppointmentItem objects created by Microsoft® Schedule+, and it is not automatically set when you create an appointment within a CDO application until you call the Update method. In these cases, the application must assign a value to Sent or an attempt to read it returns CdoE_NOT_FOUND.

The Sent property corresponds to the MSGFLAG_UNSENT flag not being set in the MAPI property PR_MESSAGE_FLAGS. It can be rendered into HTML hypertext using the CDO Rendering ObjectRenderer object. To specify this, set the object renderer's DataSource property to this Message object and the property parameter of the RenderProperty method to CdoPR_MESSAGE_FLAGS. However, you must assign a CDO Rendering Format object to the PR_MESSAGE_FLAGS property and use the Value property of the format's Pattern objects to isolate the MSGFLAG_UNSENT flag's setting for rendering.

See Also

Concepts

Message Object