MapiMessage

MapiMessage class

Inherits: Aspose::Email::Mapi::MapiMessageItemBase

Represents an Outlook Message format document that can be parsed.

Instances of the MapiMessage class are used to represent Microsoft Outlook Message document files that are parsed by MapiMessageReader class. To access the sender, recipient, and contents of an e-mail message, use the associated properties of the MapiMessage class.

The following exmaple demonstrates how to read Outlook Message files.

 //Open Outlook Message files
 MapiMessage msg = MapiMessage.Load(@"c:\outlookmessage.msg");
 
//read subject
Console.WriteLine("Subject:" + msg.Subject);
 
//sender name
Console.WriteLine("From:" + msg.SenderName);
 
//message body
Console.WriteLine("Body:" + msg.Body);
 
//Attachments
foreach(MapiAttachment att in msg.Attachments)
{
    Console.WriteLine("Attachment Name:"+att.FileName);
    att.Save(att.FileName);
}
'Open Outlook Message files
Dim msg As MapiMessage = MapiMessage.Load("c:\outlookmessage.msg")
 
'read subject
Console.WriteLine("Subject:" + msg.Subject)
 
'sender name
Console.WriteLine("From:" + msg.SenderName)
 
'message body
Console.WriteLine("Body:" + msg.Body)
 
'Attachments
For Each att As MapiAttachment In msg.Attachments
    Console.WriteLine("Attachment Name:" + att.FileName)
    att.Save(att.FileName)
Next

Constructors

NameDescription
MapiMessage (7 overloads)Initializes a new instance of the MapiMessage class.

Methods

NameDescription
AddCustomProperty (2 overloads)Adds the custom property.
AddEmbeddedImageToRtfBodyAdds string data that represents embedded image into rtf body.
ChangeMessageClassChanges the message type to the specified value.
CheckBouncedChecks whether this message can be treated as a bounce message.
CloneCreates a new object that is a copy of the current instance.
ConvertToMapiMessageConvert item to MapiMessage . Set MessageClass, Subject, Mileage and Billing.
ConvertToUnicodeConverts ASCII message to unicode.
CovertToUnicode
DestroyAttachmentsDestroies the attachments in the specified Outlook Message files. DestroyAttachments will ignore the attachment parsing.
FromMailMessage (4 overloads)Creates an instance of MapiMessage from the MailMessage .
FromObjectDataCreates the MapiMessage from the object data.
FromProperties (2 overloads)Creates an instance of MapiMessage from a collection of Mapi properties.
FromStreamInternal
get_ClientSubmitTimeGets the date and time the message sender submitted a message.
get_ConversationTopicGets the topic of the first message in a conversation thread.
get_DeliveryTimeGets the date and time a message was delivered.
get_DisplayBccGets a list of the display names of any blind carbon copy (BCC) message recipients, separated by semicolons (;).
get_DisplayCcGets a list of the display names of any carbon copy (CC) message recipients, separated by semicolons (;).
get_DisplayNameGets the display name for the message.
get_DisplayNamePrefixGets a prefix of the display name.
get_DisplayToGets a list of the display names of the primary (To) message recipients, separated by semicolons (;).
get_FlagsGets the message flags.
get_HeadersGets the transport message headers
get_InternetMessageIdGets the message id of the message.
get_IsEncryptedGets a value indicating whether the message is encrypted.
get_IsSignedGets a value indicating whether the message is signed.
get_IsTemplateDetermines whether the message is Outlook template (.oft).
get_MessageFormatGets the outlook message format.
get_NormalizedSubjectGets normalized subject of the message.
get_ReadReceiptRequestedGets a value indicating whether the read receipt is requested.
get_ReplyToGets the reply to names.
get_SenderAddressTypeGets the message sender’s e-mail address type.
get_SenderEmailAddressGets the message sender’s e-mail address.
get_SenderNameGets the message sender’s display name.
get_SenderSmtpAddressGets the message sender’s e-mail address.
get_SentRepresentingAddressTypeGets the address type for the messaging user represented by the sender.
get_SentRepresentingEmailAddressGets the e-mail address for the messaging user represented by the sender.
get_SentRepresentingNameGets the display name for the messaging user represented by the sender.
get_SentRepresentingSmtpAddressGets the e-mail address for the messaging user represented by the sender.
get_TransportMessageHeadersGets the transport-specific message envelope information.
GetAddressType
GetBlankMapiMessage
GetCustomPropertiesGets collection of custom MapiProperties.
GetSizeGets the total size of message property values.
ImportCalendarToMapiMessage (2 overloads)Imports the iCalendar to MapiMessage .
IsMsgFormat (2 overloads)Determines whether the specified stream has a MSG format.
Load (4 overloads)Loads message from stream.
LoadFromTnef (2 overloads)Loads message from Transport Neutral Encapsulation Format (TNEF) data structure
LoadInternalLoads message from stream with additional options. NOTE!!! Call this method if you don’t need to increase customer consumption credit for Dynabic.Metered.
MakeTemplate
OnConversionProgress
RemoveAttachmentsRemoves all of the attachments from the specified Outlook Message files.
Save (4 overloads)Saves to the specified stream as Msg .
SaveAsTemplate (2 overloads)Saves to the specified stream as Outlook File Template(OFT format).
SaveAsTnef (2 overloads)Save message in TNEF format.
set_ClientSubmitTimeSets the date and time the message sender submitted a message.
set_DeliveryTimeSets the date and time a message was delivered.
set_HeadersGets the transport message headers
set_ReadReceiptRequestedSets a value indicating whether the read receipt is requested.
set_ReplyToSets the reply to names.
set_SenderEmailAddressSets the message sender’s e-mail address.
set_SenderNameSets the message sender’s display name.
set_SenderSmtpAddressSets the message sender’s e-mail address.
set_SentRepresentingEmailAddressSets the e-mail address for the messaging user represented by the sender.
set_SentRepresentingNameSets the display name for the messaging user represented by the sender.
SetDateInHeaders
SetProperty (3 overloads)Sets the attachment.
SetStringPropertyValueSets the string property value.
ToMailMessageCreates an instance of MailMessage from this MapiMessage .
ToMapiMessageItemConvert MapiMessage to IMapiMessageItem object in dependence with MessageClass.
TrySetCodePageFromRtfBodyTries the set code page from RTF body.
ConversionProgressEventEvent to notify user about progress of conversion/saving.
emlBoundaries