Managing Message Files with Aspose.Email.Outlook

Converting MSG to MIME message

Aspose.Email API provides the capability of converting MSG files to MIME messages using the toMailMessage method.

Read and Write Outlook Template File (OFT)

Outlook templates are very useful when you want to send a similar email message again and again. Instead of preparing the message from scratch each time, you can first prepare the message in Microsoft Outlook and save it as an Outlook Template (OFT). After that, if you need to send the message, create it from the template and save time for writing up the same text in the body, subject, etc.

Aspose.Email’s MailMessage class can be used to load a Microsoft Outlook template (OFT) file. Once the Outlook template is loaded in an instance of the MailMessage class, you may update the sender, recipient, body, subject and other properties. After updating the properties, you can

  • send the email using SmtpClient class, or
  • save the message as MSG and do further updates or validation using Microsoft Outlook.

In the below screenshot, you can see a meeting invitation template, which is prepared using Microsoft Outlook and saved as an Outlook template (OFT). The example code loads this template using the MailMessage class, updates some of the properties and saves the message in MSG format.

todo:image_alt_text
Figure: Email template
After running the code, the email will look like the message below when it is opened in Microsoft Outlook.
todo:image_alt_text
Figure: The output email

Save as Outlook Template File (OFT)

Just as the API can read OFT files, it also provides the capability to write to OFT files as shown in the following code sample.

Setting Color Category for Outlook Message (MSG) Files

Microsoft Outlook lets users assign color categories to differentiate emails. A color category marks an email as being of some kind of importance or category. Aspose.Email provides the same feature through the FollowUpManager class. The following functionality is supported via this class:

The following example performs the tasks as given below:

  1. Add a color category.
  2. Add another color category.
  3. Retrieve the list of all categories.
  4. Remove all categories.  

Accessing Follow Up Information from Message

Aspose.Email API provides the capability to access the follow-up information from a sent or received message. It can retrieve the Read, Delivery Read Receipt and vote results information from a message file.

Retrieve Read and Delivery Receipt Information

Read the Vote Results Information

Creating Forward and Reply Messages

Aspose.Email API provides the capability of creating and formatting the forward and reply messages. The ReplyMessageBuilder and ForwardMessageBuilder classes of the API are used to create the Reply and Forward messages respectively. A Reply or Forward message can be specified to be created using any of the modes of OriginalMessageAdditionMode enum. This enum has the following values:

Create Reply Message

Create Forward Message