MailItem Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a mail message.
public interface class MailItem : Microsoft::Office::Interop::Outlook::_MailItem, Microsoft::Office::Interop::Outlook::ItemEvents_10_Event
[System.Runtime.InteropServices.Guid("00063034-0000-0000-C000-000000000046")]
public interface MailItem : Microsoft.Office.Interop.Outlook._MailItem, Microsoft.Office.Interop.Outlook.ItemEvents_10_Event
Public Interface MailItem
Implements _MailItem, ItemEvents_10_Event
- Derived
- Attributes
- Implements
Remarks
This is a .NET interface derived from a COM coclass that is required by managed code for interoperability with the corresponding COM object. Use this derived interface to access all method, property, and event members of the COM object. However, if a method or event you want to use shares the same name under the same COM object, cast to the corresponding primary interface to call the method, and cast to the latest events interface to connect to the event. Refer to this topic for information about the COM object. For information about the method and property members of the COM object, see _MailItem. For information about the event members of the COM object, see ItemEvents_10_Event.
Use the CreateItem(OlItemType) method to create a MailItem object that represents a new mail message.
Use Item[Object] (index
), where index
is the index number of a mail message or a value used to match the default property of a message, to return a single MailItem object from a specified folder.
Properties
Actions |
Returns an Actions collection that represents all the available actions for the item. Read-only. (Inherited from _MailItem) |
AlternateRecipientAllowed |
Returns a Boolean (bool in C#) that is True if the mail message can be forwarded. Read/write. (Inherited from _MailItem) |
Application |
Returns an Application object that represents the parent Outlook application for the object. Read-only. (Inherited from _MailItem) |
Attachments |
Returns an Attachments object that represents all the attachments for the specified item. Read-only. (Inherited from _MailItem) |
AutoForwarded |
A Boolean (bool in C#) value that returns True if the item was automatically forwarded. Read/write. (Inherited from _MailItem) |
AutoResolvedWinner |
Returns a Boolean (bool in C#) that determines if the item is a winner of an automatic conflict resolution. Read-only. (Inherited from _MailItem) |
BCC |
Returns a String (string in C#) representing the display list of blind carbon copy (BCC) names for a MailItem. Read/write. (Inherited from _MailItem) |
BillingInformation |
Returns or sets a String (string in C#) representing the billing information associated with the Outlook item. Read/write. (Inherited from _MailItem) |
Body |
Returns or sets a String (string in C#) representing the clear-text body of the Outlook item. Read/write. (Inherited from _MailItem) |
BodyFormat |
Returns or sets an OlBodyFormat constant indicating the format of the body text. Read/write. (Inherited from _MailItem) |
Categories |
Returns or sets a String (string in C#) representing the categories assigned to the Outlook item. Read/write. (Inherited from _MailItem) |
CC |
Returns a String (string in C#) representing the display list of carbon copy (CC) names for a MailItem. Read/write. (Inherited from _MailItem) |
Class |
Returns an OlObjectClass constant indicating the object's class. Read-only. (Inherited from _MailItem) |
Companies |
Returns or sets a String (string in C#) representing the names of the companies associated with the Outlook item. Read/write. (Inherited from _MailItem) |
Conflicts |
Return the Conflicts object that represents the items that are in conflict for any Outlook item object. Read-only. (Inherited from _MailItem) |
ConversationID |
Returns a String (string in C#) that uniquely identifies a Conversation object that the MailItem object belongs to. Read-only. (Inherited from _MailItem) |
ConversationIndex |
Returns a String (string in C#) representing the index of the conversation thread of the Outlook item. Read-only. (Inherited from _MailItem) |
ConversationTopic |
Returns a String (string in C#) representing the topic of the conversation thread of the Outlook item. Read-only. (Inherited from _MailItem) |
CreationTime |
Returns a DateTime indicating the creation time for the Outlook item. Read-only. (Inherited from _MailItem) |
DeferredDeliveryTime |
Returns or sets a DateTime indicating the date and time the mail message is to be delivered. Read/write. (Inherited from _MailItem) |
DeleteAfterSubmit |
Returns or sets a Boolean (bool in C#) value that is True if a copy of the mail message is not saved upon being sent, and False if a copy is saved. Read/write. (Inherited from _MailItem) |
DownloadState |
Returns a constant that belongs to the OlDownloadState enumeration indicating the download state of the item. Read-only. (Inherited from _MailItem) |
EnableSharedAttachments |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
EntryID |
Returns a String (string in C#) representing the unique Entry ID of the object. Read-only. (Inherited from _MailItem) |
ExpiryTime |
Returns or sets a DateTime indicating the date and time at which the item becomes invalid and can be deleted. Read/write. (Inherited from _MailItem) |
FlagDueBy |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
FlagIcon |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
FlagRequest |
Returns or sets a String (string in C#) that indicates the requested action for a mail item. Read/write. (Inherited from _MailItem) |
FlagStatus |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
FormDescription |
Returns the FormDescription object that represents the form description for the specified Outlook item. Read-only. (Inherited from _MailItem) |
GetInspector |
Returns an Inspector object that represents an inspector initialized to contain the specified item. Read-only. (Inherited from _MailItem) |
HasCoverSheet |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
HTMLBody |
Returns or sets a String (string in C#) representing the HTML body of the specified item. Read/write. (Inherited from _MailItem) |
Importance |
Returns or sets an OlImportance constant indicating the relative importance level for the Outlook item. Read/write. (Inherited from _MailItem) |
InternetCodepage |
Returns or sets an Integer (int in C#) value that determines the Internet code page used by the item. Read/write. (Inherited from _MailItem) |
IsConflict |
Returns a Boolean (bool in C#) that determines if the item is in conflict. Read-only. (Inherited from _MailItem) |
IsIPFax |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
IsMarkedAsTask |
Returns a Boolean (bool in C#) value that indicates whether the MailItem is marked as a task. Read-only. (Inherited from _MailItem) |
ItemProperties |
Returns an ItemProperties collection that represents all standard and user-defined properties associated with the Outlook item. Read-only. (Inherited from _MailItem) |
LastModificationTime |
Returns a DateTime specifying the date and time that the Outlook item was last modified. Read-only. (Inherited from _MailItem) |
Links |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
MAPIOBJECT |
This object, member, or enumeration is deprecated and is not intended to be used in your code. (Inherited from _MailItem) |
MarkForDownload |
Returns or sets an OlRemoteStatus constant that determines the status of an item once it is received by a remote user. Read/write. (Inherited from _MailItem) |
MessageClass |
Returns or sets a String (string in C#) representing the message class for the Outlook item. Read/write. (Inherited from _MailItem) |
Mileage |
Returns or sets a String (string in C#) representing the mileage for an item. Read/write. (Inherited from _MailItem) |
NoAging |
Returns or sets a Boolean (bool in C#) value that is True to not age the Outlook item. Read/write. (Inherited from _MailItem) |
OriginatorDeliveryReportRequested |
Returns or sets a Boolean (bool in C#) value that determines whether the originator of the meeting item or mail message will receive a delivery report. Read/write. (Inherited from _MailItem) |
OutlookInternalVersion |
Returns an Integer (int in C#) value representing the build number of the Outlook application for an Outlook item. Read-only. (Inherited from _MailItem) |
OutlookVersion |
Returns a String (string in C#) indicating the major and minor version number of the Outlook application for an Outlook item. Read-only. (Inherited from _MailItem) |
Parent |
Returns the parent Object of the specified object. Read-only. (Inherited from _MailItem) |
Permission |
Sets or returns an OlPermission constant that determines the permissions the recipients will have on the e-mail item. Read/write. (Inherited from _MailItem) |
PermissionService |
Sets or returns an OlPermissionService constant that determines the permission service that will be used when sending a message protected by Information Rights Management (IRM). Read/write. (Inherited from _MailItem) |
PermissionTemplateGuid |
Returns or sets a String (string in C#) value that represents the GUID of the template file to apply to the MailItem in order to specify Information Rights Management (IRM) permissions. Read/write. (Inherited from _MailItem) |
PropertyAccessor |
Returns a PropertyAccessor object that supports creating, getting, setting, and deleting properties of the parent MailItem object. Read-only. (Inherited from _MailItem) |
ReadReceiptRequested |
Returns a Boolean (bool in C#) value that indicates True if a read receipt has been requested by the sender. (Inherited from _MailItem) |
ReceivedByEntryID |
Returns a String (string in C#) representing the EntryID for the true recipient as set by the transport provider delivering the mail message. Read-only. (Inherited from _MailItem) |
ReceivedByName |
Returns a String (string in C#) representing the display name of the true recipient for the mail message. Read-only. (Inherited from _MailItem) |
ReceivedOnBehalfOfEntryID |
Returns a String (string in C#) representing the EntryID of the user delegated to represent the recipient for the mail message. Read-only. (Inherited from _MailItem) |
ReceivedOnBehalfOfName |
Returns a String (string in C#) representing the display name of the user delegated to represent the recipient for the mail message. Read-only. (Inherited from _MailItem) |
ReceivedTime |
Returns a DateTime indicating the date and time at which the item was received. Read-only. (Inherited from _MailItem) |
RecipientReassignmentProhibited |
Returns a Boolean (bool in C#) that indicates True if the recipient cannot forward the mail message. Read/write. (Inherited from _MailItem) |
Recipients |
Returns a Recipients collection that represents all the recipients for the Outlook item. Read-only. (Inherited from _MailItem) |
ReminderOverrideDefault |
Returns or sets a Boolean (bool in C#) value that is True if the reminder overrides the default reminder behavior for the item. Read/write. (Inherited from _MailItem) |
ReminderPlaySound |
Returns or sets a Boolean (bool in C#) value that is True if the reminder should play a sound when it occurs for this item. Read/write. (Inherited from _MailItem) |
ReminderSet |
Returns or sets a Boolean (bool in C#) value that is True if a reminder has been set for this item. Read/write. (Inherited from _MailItem) |
ReminderSoundFile |
Returns or sets a String (string in C#) indicating the path and file name of the sound file to play when the reminder occurs for the Outlook item. Read/write. (Inherited from _MailItem) |
ReminderTime |
Returns or sets a DateTime indicating the date and time at which the reminder should occur for the specified item. Read/write. (Inherited from _MailItem) |
RemoteStatus |
Returns or sets an OlRemoteStatus constant specifying the remote status of the mail message. Read/write. (Inherited from _MailItem) |
ReplyRecipientNames |
Returns a semicolon-delimited String (string in C#) list of reply recipients for the mail message. Read-only. (Inherited from _MailItem) |
ReplyRecipients |
Returns a Recipients collection that represents all the reply recipient objects for the Outlook item. Read-only. (Inherited from _MailItem) |
RetentionExpirationDate |
Returns a DateTime value that specifies the date when the MailItem object expires, after which the Messaging Records Management (MRM) Assistant will delete the item. Read-only. (Inherited from _MailItem) |
RetentionPolicyName |
Returns a String (string in C#) that specifies the name of the retention policy. Read-only. (Inherited from _MailItem) |
RTFBody |
Returns or sets a byte array that represents the body of the Microsoft Outlook item in Rich Text Format. Read/write. (Inherited from _MailItem) |
Saved |
Returns a Boolean (bool in C#) value that is True if the Outlook item has not been modified since the last save. Read-only. (Inherited from _MailItem) |
SaveSentMessageFolder |
Returns or sets a Folder object that represents the folder in which a copy of the e-mail message will be saved after being sent. Read/write. (Inherited from _MailItem) |
Sender |
Returns or sets an AddressEntry object that corresponds to the user of the account from which the MailItem is sent. Read/write. (Inherited from _MailItem) |
SenderEmailAddress |
Returns a String (string in C#) that represents the e-mail address of the sender of the Outlook item. Read-only. (Inherited from _MailItem) |
SenderEmailType |
Returns a String (string in C#) that represents the type of entry for the e-mail address of the sender of the Outlook item, such as 'SMTP' for Internet address, 'EX' for a Microsoft Exchange server address, etc. Read-only. (Inherited from _MailItem) |
SenderName |
Returns a String (string in C#) indicating the display name of the sender for the Outlook item. Read-only. (Inherited from _MailItem) |
SendUsingAccount |
Returns or sets an Account object that represents the account under which the MailItem is to be sent. Read/write. (Inherited from _MailItem) |
Sensitivity |
Returns or sets a constant in the OlSensitivity enumeration indicating the sensitivity for the Outlook item. Read/write. (Inherited from _MailItem) |
Sent |
Returns a Boolean (bool in C#) value that indicates if a message has been sent. Read-only. (Inherited from _MailItem) |
SentOn |
Returns a DateTime indicating the date and time on which the Outlook item was sent. Read-only. (Inherited from _MailItem) |
SentOnBehalfOfName |
Returns a String (string in C#) indicating the display name for the intended sender of the mail message. Read/write. (Inherited from _MailItem) |
Session |
Returns the NameSpace object for the current session. Read-only. (Inherited from _MailItem) |
Size |
Returns an Integer (int in C#) value indicating the size (in bytes) of the Outlook item. Read-only. (Inherited from _MailItem) |
Subject |
Returns or sets a String (string in C#) indicating the subject for the Outlook item. Read/write. (Inherited from _MailItem) |
Submitted |
Returns a Boolean (bool in C#) value that is True if the item has been submitted. Read-only. (Inherited from _MailItem) |
TaskCompletedDate |
Returns or sets a DateTime value that represents the completion date of the task for this MailItem. Read/write. (Inherited from _MailItem) |
TaskDueDate |
Returns or sets a DateTime value that represents the due date of the task for this MailItem. Read/write. (Inherited from _MailItem) |
TaskStartDate |
Returns or sets a DateTime value that represents the start date of the task for this MailItem object. Read/write. (Inherited from _MailItem) |
TaskSubject |
Returns or sets a String (string in C#) value that represents the subject of the task for the MailItem object. Read/write. (Inherited from _MailItem) |
To |
Returns or sets a semicolon-delimited String (string in C#) list of display names for the To recipients for the Outlook item. Read/write. (Inherited from _MailItem) |
ToDoTaskOrdinal |
Returns or sets a DateTime value that represents the ordinal value of the task for the MailItem. Read/write. (Inherited from _MailItem) |
UnRead |
Returns or sets a Boolean (bool in C#) value that is True if the Outlook item has not been opened (read). Read/write. (Inherited from _MailItem) |
UserProperties |
Returns the UserProperties collection that represents all the user properties for the Outlook item. Read-only. (Inherited from _MailItem) |
VotingOptions |
Returns or sets a String (string in C#) specifying a delimited string containing the voting options for the mail message. Read/write. (Inherited from _MailItem) |
VotingResponse |
Returns or sets a String (string in C#) specifying the voting response for the mail message. Read/write. (Inherited from _MailItem) |
Methods
AddBusinessCard(ContactItem) |
Appends contact information based on the Electronic Business Card (EBC) associated with the specified ContactItem object to the MailItem object. (Inherited from _MailItem) |
ClearConversationIndex() |
Clears the index of the conversation thread for the mail message. (Inherited from _MailItem) |
ClearTaskFlag() |
Clears the MailItem object as a task. (Inherited from _MailItem) |
Close(OlInspectorClose) |
Closes and optionally saves changes to the Outlook item. (Inherited from _MailItem) |
Copy() |
Creates another instance of an object. (Inherited from _MailItem) |
Delete() |
Removes the item from the folder that contains the item. (Inherited from _MailItem) |
Display(Object) |
Displays a new Inspector object for the item. (Inherited from _MailItem) |
GetConversation() |
Obtains a Conversation object that represents the conversation to which this item belongs. (Inherited from _MailItem) |
MarkAsTask(OlMarkInterval) |
Marks a MailItem object as a task and assigns a task interval for the object. (Inherited from _MailItem) |
Move(MAPIFolder) |
Moves a Microsoft Outlook item to a new folder. (Inherited from _MailItem) |
PrintOut() |
Prints the Outlook item using all default settings. The PrintOut method is the only Outlook method that can be used for printing. (Inherited from _MailItem) |
Save() |
Saves the Outlook item to the current folder or, if this is a new item, to the Outlook default folder for the item type. (Inherited from _MailItem) |
SaveAs(String, Object) |
Saves the Microsoft Outlook item to the specified path and in the format of the specified file type. If the file type is not specified, the MSG format (.msg) is used. (Inherited from _MailItem) |
ShowCategoriesDialog() |
Displays the Show Categories dialog box, which allows you to select categories that correspond to the subject of the item. (Inherited from _MailItem) |
Events
AfterWrite |
Occurs after Microsoft Outlook has saved the item. (Inherited from ItemEvents_10_Event) |
AttachmentAdd |
Occurs when an attachment has been added to an instance of the parent object. (Inherited from ItemEvents_10_Event) |
AttachmentRead |
Occurs when an attachment in an instance of the parent object has been opened for reading. (Inherited from ItemEvents_10_Event) |
AttachmentRemove |
Occurs when an attachment has been removed from an instance of the parent object. (Inherited from ItemEvents_10_Event) |
BeforeAttachmentAdd |
Occurs before an attachment is added to an instance of the parent object. (Inherited from ItemEvents_10_Event) |
BeforeAttachmentPreview |
Occurs before an attachment associated with an instance of the parent object is previewed. (Inherited from ItemEvents_10_Event) |
BeforeAttachmentRead |
Occurs before an attachment associated with an instance of the parent object is read from the file system, an attachment stream, or an Attachment object. (Inherited from ItemEvents_10_Event) |
BeforeAttachmentSave |
Occurs just before an attachment is saved. (Inherited from ItemEvents_10_Event) |
BeforeAttachmentWriteToTempFile |
Occurs before an attachment associated with an instance of the parent object is written to a temporary file. (Inherited from ItemEvents_10_Event) |
BeforeAutoSave |
Occurs before the item is automatically saved by Outlook. (Inherited from ItemEvents_10_Event) |
BeforeCheckNames |
Occurs just before Microsoft Outlook starts resolving names in the recipient collection for an item (which is an instance of the parent object). (Inherited from ItemEvents_10_Event) |
BeforeDelete |
Occurs before an item (which is an instance of the parent object) is deleted. (Inherited from ItemEvents_10_Event) |
BeforeRead |
Occurs before Microsoft Outlook begins to read the properties for the item. (Inherited from ItemEvents_10_Event) |
Close |
Occurs when the inspector associated with an item (which is an instance of the parent object) is being closed. (Inherited from ItemEvents_10_Event) |
CustomAction |
Occurs when a custom action of an item (which is an instance of the parent object) executes. (Inherited from ItemEvents_10_Event) |
CustomPropertyChange |
Occurs when a custom property of an item (which is an instance of the parent object) is changed. (Inherited from ItemEvents_10_Event) |
Forward |
Occurs when the user selects the Forward action for an item (which is an instance of the parent object). (Inherited from ItemEvents_10_Event) |
Open |
Occurs when an instance of the parent object is being opened in an Inspector. (Inherited from ItemEvents_10_Event) |
PropertyChange |
Occurs when an explicit built-in property of an instance of the parent object is changed. (Inherited from ItemEvents_10_Event) |
Read |
Occurs when an instance of the parent object is opened for editing by the user. (Inherited from ItemEvents_10_Event) |
ReadComplete |
Occurs when Outlook has completed reading the properties of the item. (Inherited from ItemEvents_10_Event) |
Reply |
Occurs when the user selects the Reply action for an item (which is an instance of the parent object). (Inherited from ItemEvents_10_Event) |
ReplyAll |
Occurs when the user selects the ReplyAll action for an item (which is an instance of the parent object). (Inherited from ItemEvents_10_Event) |
Send |
Occurs when the user selects the Send action for an item (which is an instance of the parent object). (Inherited from ItemEvents_10_Event) |
Unload |
Occurs before an Outlook item is unloaded from memory, either programmatically or by user action. (Inherited from ItemEvents_10_Event) |
Write |
Occurs when an instance of the parent object is saved, either explicitly or implicitly (for example, in response to a prompt when closing the item's inspector). (Inherited from ItemEvents_10_Event) |