The IMessage interface defines methods and properties that are used by implementing objects to provide messaging functionality. Component Object Model (COM) classes that provide an implementation of the IMessage interface allow you to:
-
Address messages and otherwise define the top-level message headers using interface properties or the Fields collection.
-
Create or modify the message content, including content formatted in Multipurpose Internet Mail Extensions (MIME)
-
Retrieve the message as a stream encoded in MIME or Uuencode using the GetStream method.
-
Send or post messages and respond to existing messages
All mail headers are available generically through the Fields collection. The most common mail headers, such as To, From, CC, and Subject, are directly available on the interface.
COM classes that provide implementations of the IMessage interface also provide implementations of the IBodyPart and IDataSource interfaces. These interfaces can be retrieved using the standard interface navigation mechanisms, such as QueryInterface in C++ and the Set keyword in Microsoft® Visual Basic®, through the Bodypart and DataSource properties (respectively) on this interface, or by using the GetInterface method. The GetInterface method is intended primarily to provide scripting languages that do not inherently support interface navigation a means to do so; however, the method can be used from any language.
The methods on the IMessage interface fall into two general categories: those used to send, post, or respond to messages; and those used as aids when creating message content. Methods such as Send, Post, and Reply are examples of the first category and methods such as AddAttachment and CreateMHTMLBody are examples of the second.
The specific actions for methods such as Send or Post are defined using configuration fields that are contained within an associated Configuration object (IConfiguration interface).