MAPISetMessageType

Syntax

MAPISetMessageType(MessageType$)

Remarks

Sets the message type of the current outbound message. Message types allow custom messages within Mail. You can use custom messages to associate messages with specific projects or applications. Messages can be interpersonal messages that appear in the user's Inbox, or interprocess communication messages that are invisible to the user. The MessageType$ argument begins with "IPM." for interpersonal messages or with "IPC." for interprocess communication messages. The standard format for message types is "IPM.Vendor.Application" or "IPC.Vendor.Application."

Use MAPIFindNext to retrieve messages using the message type. This procedure is faster and more reliable than retrieving every message in the Inbox or searching for certain strings within the message subject or note text.

Message types are optional. For normal interpersonal messages, do not use MAPISetMessageType, or specify an empty string ("").

If your application generates IPC messages, you should provide users or administrators with a utility to find and delete outdated IPC messages in the Inbox. For an example, see MAPIFindNext.

Argument

Explanation

MessageType$

A string that is the message type


Example

The following example sends a message with a custom message type.


Sub MAIN
MAPI_LOGON_UI = 1
Session = MAPILogon(0, "", "", MAPI_LOGON_UI, 0)
result = MAPISetRecipient(1, "Michael Ranwez", "")
result = MAPISetMessageType("IPM.Sample.Report")
result = MAPISendMail(Session, 0, "Monthly Summary",\
    "We will quickly satisfy all orders for clamps.", 0, 0)
result = MAPILogoff(Session, 0, 0, 0)
End Sub