Office 2013 and later

This section provides sample tasks that involve mail items. A mail item represents a mail message in a folder.

How to: Create a Mail Item by Using a Message Template

Creates a mail item by using the CreateItemFromTemplate method.

How to: Create a Mail Item, Attach a Report, and Send the Mail Item to the User's Manager

Creates a mail item that has an attachment, and then sends the mail item to the user's manager.

How to: Send an E-Mail Given the SMTP Address of an Account

Creates an e-mail and sends it from a Microsoft Outlook account, given the Simple Mail Transfer Protocol (SMTP) address of that account.

How to: Add Voting Options to a Mail Item

Uses the VotingOptions property of the MailItem object to add voting options to an e-mail message.

How to: Add a Custom Action as a Response to a Mail Item

Adds custom actions as a response to an e-mail item by using the Add() method of the Actions collection.

How to: Get the SMTP Address of the Sender of a Mail Item

Gets the sender’s Simple Mail Transfer Protocol (SMTP) address for a mail item.

How to: Specify Different Recipient Types for a Mail Item

Programmatically sets different recipient types (To, Cc, or Bcc) for a mail item.