Introduction to MAPI Message Files API
MAPI Message Files
Aspose.Email Cloud supports files in Microsoft Outlook Email format (MSG files).
First of all, the MSG file could be represented as a list of properties. See this JSON example:
These properties could contain different values. It could be integers, strings, bytes, multiple strings, and a lot of other data types. All properties are identified using property Descriptors. Aspose.Email Cloud supports different types of property descriptors:
- MapiPidTagPropertyDescriptor - A property, identified by a tag, which consists of a combination of data type and identifier.
- MapiPidLidPropertyDescriptor - A property, identified by a long id and a property set.
- MapiPidNamePropertyDescriptor - A property, identified by a name and a property set.
- MapiKnownPropertyDescriptor - This descriptor implies one of three previous descriptors. It is a property, that is known to Aspose.Email Cloud, so it can be fully identified by the property name. See all known properties here.
Aspose.Email Cloud provides 3 different models to represent the MSG file. These models contain a list of all properties and extra fields for easier file operation. For example, MapiMessageDto has a string field named Subject, which contains a subject for an email message. But this field is just a copy of a property with a TagSubject descriptor:
These 3 MAPI models are:
- MapiMessageDto - represents an email message. Has properties to represent a message’s subject, body, sender, recipients, etc.
- MapiCalendarDto - represents an appointment or a meeting object. Provides properties for meeting start and end, location, recurrence, busy status, etc.
- MapiContactDto - represents a contact. Provides properties for name, telephone, email addresses, etc.
All these models can be converted to the corresponding usual models and back:
Aspose.Email Cloud also provides methods to save these models to files in different formats and to read these files back to the corresponding models.
Quick start with MAPI message files API
Aspose.Email Cloud SDK provides the same sets of methods for all supported MAPI models:
- Convert from the usual model to a MAPI model.
- Convert from the MAPI model to a usual model.
- Convert a MAPI model object to a file in a specified format.
- Read a file to a MAPI model.
- Save a MAPI model as a file on the cloud storage.
- Read a file from the cloud storage to a MAPI model.
You can see all these methods in action in examples below:
MapiMessageDto methods
Convert EmailDto to MapiMessageDto
Convert MapiMessageDto to EmailDto
Convert MapiMessageDto to a File and Back
Convert MapiMessageDto to a File and Back
MapiMessageDto and Cloud Storage
MapiContactDto methods
Convert ContactDto to MapiContactDto
Convert MapiContactDto to ContactDto
Convert MapiContactDto to a File and Back
MapiContactDto and Cloud Storage
MapiCalendarDto methods
Convert CalendarDto to MapiCalendarDto
Convert MapiCalendarDto to CalendarDto
How to Convert MapiCalendarDto to CalendarDto:
Convert MapiCalendarDto to a File and Back
MapiCalendarDto and Cloud Storage
More Tutorials
Take a look at other tutorials, you may find answers on your questions there: