Provides possibility to handle rendering of hyperlink in custom style. More...

Inherits IDisposable, Aspose::Email::IPreferredTextEncodingProvider, System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Email::MailMessage > >, and Aspose::Email::IMessage.

Inherited by Aspose::Email::Amp::AmpMessage.

Public Member Functions

System::String get_Preamble ()
 Gets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers. More...
 
void set_Preamble (System::String value)
 Sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers. More...
 
System::String get_Epilogue ()
 Gets an epilogue text. It is located after the last boundary. More...
 
void set_Epilogue (System::String value)
 Sets an epilogue text. It is located after the last boundary. More...
 
System::SharedPtr< System::Collections::Generic::Dictionary< System::SharedPtr< Mapi::PropertyDescriptor >, System::SharedPtr< System::Object > > > get_ExtendedProperties () const
 Gets extended properties of a message. More...
 
bool get_PreserveTnefAttachment () const
 Controls TNEF attachment load/save behaviour More...
 
void set_PreserveTnefAttachment (bool value)
 Controls TNEF attachment load/save behaviour More...
 
System::SharedPtr< System::Text::Encoding > get_PreferredTextEncoding () override
 Gets preferred encoding for all text properties More...
 
void set_PreferredTextEncoding (System::SharedPtr< System::Text::Encoding > value) override
 Sets preferred encoding for all text properties More...
 
System::ArrayPtr< System::String > get_Categories () const
 Gets exchange message categories More...
 
void set_Categories (System::ArrayPtr< System::String > value)
 Sets exchange message categories More...
 
System::SharedPtr< MailAddressget_From () override
 Gets the from address More...
 
void set_From (System::SharedPtr< MailAddress > value) override
 Sets the from address More...
 
virtual System::SharedPtr< MailAddressget_Sender ()
 Gets sender address More...
 
virtual void set_Sender (System::SharedPtr< MailAddress > value)
 Sets sender address More...
 
virtual System::SharedPtr< MailAddressget_ReversePath ()
 Gets ReversePath address More...
 
virtual void set_ReversePath (System::SharedPtr< MailAddress > value)
 Sets ReversePath address More...
 
virtual System::SharedPtr< MailAddressCollectionget_ReplyToList ()
 Gets the list of addresses to reply to for the mail message More...
 
virtual void set_ReplyToList (System::SharedPtr< MailAddressCollection > value)
 Sets the list of addresses to reply to for the mail message More...
 
System::SharedPtr< MailAddressCollectionget_To () override
 Gets the address collection that contains the recipients of message More...
 
virtual void set_To (System::SharedPtr< MailAddressCollection > value)
 Sets the address collection that contains the recipients of message More...
 
System::SharedPtr< MailAddressCollectionget_Bcc () override
 Gets the address collection that contains the BCC recipients of message More...
 
virtual void set_Bcc (System::SharedPtr< MailAddressCollection > value)
 Sets the address collection that contains the BCC recipients of message More...
 
bool get_SuppressBcc ()
 Indicates whether Bcc header is suppressed in MIME. More...
 
void set_SuppressBcc (bool value)
 Indicates whether Bcc header is suppressed in MIME. More...
 
System::SharedPtr< MailAddressCollectionget_CC () override
 Gets the address collection that contains the CC recipients More...
 
virtual void set_CC (System::SharedPtr< MailAddressCollection > value)
 Sets the address collection that contains the CC recipients More...
 
virtual MailPriority get_Priority ()
 Gets the priority of message More...
 
virtual void set_Priority (MailPriority value)
 Sets the priority of message More...
 
virtual MailSensitivity get_Sensitivity ()
 Gets the sensitivity of message More...
 
virtual void set_Sensitivity (MailSensitivity value)
 Sets the sensitivity of message More...
 
virtual Aspose::Email::DeliveryNotificationOptions get_DeliveryNotificationOptions ()
 Gets the delivery notifications More...
 
virtual void set_DeliveryNotificationOptions (Aspose::Email::DeliveryNotificationOptions value)
 Sets the delivery notifications More...
 
System::String get_Subject () override
 Gets the subject line More...
 
void set_Subject (System::String value) override
 Sets the subject line More...
 
System::String get_ListUnsubscribe ()
 The List-Unsubscribe field describes the command (preferably using mail) to directly unsubscribe the user(removing them from the list). For more details please see https://tools.ietf.org/html/rfc2369 More...
 
void set_ListUnsubscribe (System::String value)
 The List-Unsubscribe field describes the command (preferably using mail) to directly unsubscribe the user(removing them from the list). For more details please see https://tools.ietf.org/html/rfc2369 More...
 
System::TimeSpan get_TimeZoneOffset ()
 Gets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC. More...
 
void set_TimeZoneOffset (System::TimeSpan value)
 Sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC. More...
 
System::DateTime get_Date () override
 Gets the date of message More...
 
virtual void set_Date (System::DateTime value)
 Sets the date of message More...
 
virtual System::String get_MessageId ()
 Gets the message id More...
 
virtual void set_MessageId (System::String value)
 Sets the message id More...
 
virtual System::String get_XMailer ()
 Gets the X-Mailer the software that created the e-mail message More...
 
virtual void set_XMailer (System::String value)
 Sets the X-Mailer the software that created the e-mail message More...
 
virtual System::SharedPtr< System::Text::Encoding > get_SubjectEncoding ()
 Gets the encoding of subject More...
 
virtual void set_SubjectEncoding (System::SharedPtr< System::Text::Encoding > value)
 Sets the encoding of subject More...
 
virtual System::SharedPtr< Mime::HeaderCollectionget_Headers ()
 Gets headers collection of message More...
 
System::String get_HtmlBody () override
 Gets html body More...
 
void set_HtmlBody (System::String value) override
 Sets html body More...
 
System::String get_Body () override
 Gets the plain text representation of message's body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.
More...
 
void set_Body (System::String value) override
 Sets the plain text representation of message's body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.
More...
 
virtual System::SharedPtr< System::Text::Encoding > get_BodyEncoding ()
 Gets encoding of body More...
 
virtual void set_BodyEncoding (System::SharedPtr< System::Text::Encoding > value)
 Sets encoding of body More...
 
virtual bool get_IsBodyHtml ()
 Gets a value indicating whether the message body is in Html More...
 
virtual void set_IsBodyHtml (bool value)
 Sets a value indicating whether the message body is in Html More...
 
virtual bool get_IsSigned ()
 Gets a value indicating whether the message is signed. More...
 
virtual bool get_IsEncrypted ()
 Gets a value indicating whether the message is encrypted. More...
 
virtual bool get_IsReadOnly ()
 Gets a value indicating whether the message is read only More...
 
virtual System::SharedPtr< MailboxInfoget_ItemId ()
 Represents identification information about message in a mailbox. More...
 
virtual void set_ItemId (System::SharedPtr< MailboxInfo > value)
 Represents identification information about message in a mailbox. More...
 
bool get_IsRead ()
 
virtual bool get_IsDraft ()
 Gets value that indicates whether or not a message has been sent. More...
 
virtual void set_IsDraft (bool value)
 Sets value that indicates whether or not a message has been sent. More...
 
System::SharedPtr< AttachmentCollectionget_Attachments () override
 Gets the collection of attachments of message More...
 
virtual System::SharedPtr< LinkedResourceCollectionget_LinkedResources ()
 Gets the collection of linked resources of message More...
 
virtual System::SharedPtr< AlternateViewCollectionget_AlternateViews ()
 Gets the collection of alternate views of message More...
 
Mapi::BodyContentType get_BodyType () override
 Gets the type of the body. More...
 
virtual bool get_OriginalIsTnef ()
 Gets a value indicating whether original EML message is in TNEF format. More...
 
System::SharedPtr< Aspose::Email::Message > get_Message () const
 
System::SharedPtr< Aspose::Email::Tnef::TnefAttachment > get_TnefAttachment () const
 Gets the tnef attachment. More...
 
void set_TnefAttachment (System::SharedPtr< Aspose::Email::Tnef::TnefAttachment > value)
 Gets the tnef attachment. More...
 
System::SharedPtr< MailAddressCollectionget_ReadReceiptTo ()
 Gets the read receipt address. More...
 
void set_ReadReceiptTo (System::SharedPtr< MailAddressCollection > value)
 Sets the read receipt address. More...
 
bool get_ReadReceiptRequested () const
 
void set_ReadReceiptRequested (bool value)
 
System::SharedPtr< System::Object > get_VentLicense () const
 This stores the venture licensing state instead of 2 obvious fields such as string value for watermark and some value indicating license is set or not. More...
 
bool get_IsEmpty ()
 
 MailMessage (System::String from, System::String to)
 Initializes a new instance of the MailMessage class More...
 
 MailMessage ()
 Initializes a new instance of the MailMessage class More...
 
 MailMessage (bool increaseCredit)
 Initializes a new instance of the MailMessage class More...
 
 MailMessage (System::String from, System::String to, System::String subject, System::String body)
 Initializes a new instance of the MailMessage class More...
 
 MailMessage (System::SharedPtr< MailAddress > from, System::SharedPtr< MailAddress > to)
 Initializes a new instance of the MailMessage class More...
 
virtual void set_From (System::String value)
 
virtual void set_Sender (System::String value)
 
virtual void set_ReplyToList (System::String value)
 
virtual void set_ReplyToList (System::SharedPtr< MailAddress > value)
 
virtual void set_To (System::String value)
 
virtual void set_To (System::SharedPtr< MailAddress > value)
 
System::String GetAlternateViewContent (System::String mediaType)
 Gets the content as a string from the specified AlternateView. More...
 
virtual void Import (System::SharedPtr< System::IO::Stream > stream)
 Populates a T:System::Runtime::Serialization::SerializationInfo with the data needed to serialize the target object. More...
 
virtual System::SharedPtr< MailMessageClone ()
 Clones this instance More...
 
void RecomposeTnefContent ()
 Composes the TNEF content. Note, that tnef attachment is composed if a message initially contained TNEF and was loaded without FileCompatibilityMode.PreserveTnefAttachments flag, That is this method doesn't create tnef message out of the regular one. More...
 
virtual void SetHtmlBody (System::String value, bool detectEncoding)
 Sets html body. More...
 
virtual System::String GetHtmlBodyText (bool showUrl)
 Gets the message html body as plain text. This method parses the HtmlBody property and returns plain text content ignoring the html markup. More...
 
virtual System::String GetHtmlBodyText (Common::Transform::HyperlinkRenderingCallback hyperlinkRenderingCallback)
 Gets the message htmlbody as plain text. More...
 
void Save (System::String fileName) override
 Save message as a file More...
 
virtual void Save (System::String fileName, System::SharedPtr< SaveOptions > options)
 Save message as a file with additional options. More...
 
virtual void Save (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< SaveOptions > options)
 Save message as a stream with additional options. More...
 
int32_t GetHashCode () const override
 Returns a hash code for object More...
 
bool Equals (System::SharedPtr< System::Object > obj) override
 Determines whether the specified Object is equal to the current Object. More...
 
void Save (System::SharedPtr< System::IO::Stream > stream) override
 Save message as a stream More...
 
virtual void set_ReadReceiptTo (System::String value)
 
System::SharedPtr< MailMessageCreateReadReceipt (System::String from, System::String bodyText)
 Creates the read receipt. More...
 
virtual void AddAlternateView (System::SharedPtr< AlternateView > view)
 Add an alternate view to message More...
 
virtual void AddAttachment (System::SharedPtr< Attachment > attachment)
 Add an attachment to message More...
 
void Dispose () override
 Releases all resources used by the MailMessage More...
 
virtual System::SharedPtr< Bounce::BounceResultCheckBounced ()
 Checks whether this message can be treated as a bounce message. More...
 
void OnConversionProgress (System::SharedPtr< ProgressEventHandlerInfo > info)
 
void ImportHeaders (System::SharedPtr< Aspose::Email::Message > message)
 
void ImportHeaders (System::SharedPtr< System::IO::Stream > stream)
 
System::String GetHeadersAsString ()
 
void ForceTextContentType ()
 
void SetMessageId (System::String value)
 
void Send (System::SharedPtr< Mime::BaseWriter > writer, System::SharedPtr< ProgressEventHandlerInfo > progressInfo)
 
System::String BuildDeliveryStatusNotificationString ()
 
int32_t GetLinkedResourceCount ()
 Gets the count of message linked resources and alternative view linked resourced. More...
 
void SetVentureLicense (System::SharedPtr< System::Object > ventureLicense)
 All Aspose products should implement this method. It is called by a GroupDocs product to indicate whether GroupDocs itself is licensed or not and specify a custom watermark. When GroupDocs is licensed, this document instance should behave as licensed too even if the Aspose product is not licensed. More...
 
System::SharedPtr< System::Collections::Generic::ListExt< System::String > > SetContent ()
 
System::ArrayPtr< uint8_t > CreateContentData (System::SharedPtr< System::Collections::Generic::ListExt< System::String >> &signedBoundaries)
 
System::ArrayPtr< uint8_t > CreateDKIMContentData (System::SharedPtr< System::Collections::Generic::ListExt< System::String >> &signedBoundaries)
 
void Replace (System::String mediaType, System::SharedPtr< AlternateView > view)
 
void LoadMessageStructure (System::SharedPtr< Clients::Imap::Commands::BodyStructureMultiPart > bodyStructure, System::SharedPtr< Clients::Imap::Commands::BodyStructurePart > &textBodyPart, System::SharedPtr< Clients::Imap::Commands::BodyStructurePart > &htmlBodyPart)
 Loads the message structure and search text body and html body parts' indexes More...
 
System::SharedPtr< AlternateViewGetHtmlView ()
 
System::SharedPtr< AlternateViewGetTextPlainView ()
 
System::SharedPtr< System::Collections::Generic::ListExt< System::SharedPtr< AttachmentBase > > > ListAttachmentBase ()
 
System::String ToString () const override
 Returns a string that represents the current object. More...
 

Static Public Member Functions

static System::SharedPtr< MailMessageLoad (System::String fileName)
 Load message from file More...
 
static System::SharedPtr< MailMessageLoad (System::SharedPtr< System::IO::Stream > stream)
 Load message from stream More...
 
static System::SharedPtr< MailMessageLoadInternal (System::SharedPtr< System::IO::Stream > stream)
 Load message from stream. NOTE!!! Call this method if you don't need to increase customer consumption credit for Dynabic.Metered. More...
 
static System::SharedPtr< MailMessageLoad (System::String fileName, System::SharedPtr< LoadOptions > options)
 Load message from file with additional options. More...
 
static System::SharedPtr< MailMessageLoad (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< LoadOptions > options)
 Load message from stream with additional options. More...
 
static System::SharedPtr< MailMessageLoadInternal (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< LoadOptions > options)
 Load message from stream with additional options. NOTE!!! Call this method if you don't need to increase customer consumption credit for Dynabic.Metered. More...
 
static System::SharedPtr< System::IO::MemoryStream > GetEmlStream (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< System::Collections::Generic::ListExt< uint8_t >> &headerBytes)
 
static System::SharedPtr< EmlValidationErrorCollectionValidateMessage (System::String fileName)
 Validate eml message for corresponding to mime specification. More...
 
static System::SharedPtr< EmlValidationErrorCollectionValidateMessage (System::SharedPtr< System::IO::Stream > stream)
 Validate eml message for corresponding to mime specification. More...
 
static System::SharedPtr< System::Text::Encoding > TryGetEncodingFromHtmlBody (System::String htmlBody)
 

Public Attributes

System::SharedPtr< AlternateViewCollectionviews
 
System::SharedPtr< AttachmentCollectionattachments
 
System::SharedPtr< LinkedResourceCollectionlinkedResources
 
System::String body
 
System::String bodyHtml
 
System::SharedPtr< System::Text::Encoding > bodyEncoding
 
bool isBodyHtml
 
bool disposed
 
System::SharedPtr< Aspose::Email::Message > message
 
Aspose::Email::DeliveryNotificationOptions deliveryStatusNotification
 
System::SharedPtr< System::Collections::Generic::ListExt< System::String > > boundaries
 
bool isProcessedByMboxrdStorageWriter
 The property is true, if the current message is processed by a MboxrdStorageWriter. See EMAILNET-38895 and EMAILNET-39005 More...
 
System::Event< void(System::SharedPtr< ProgressEventHandlerInfo >)> ConversionProgressEvent
 Event to notify user about progress of conversion/saving. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources More...
 
virtual ~MailMessage ()
 

Friends

class Aspose::Email::Attachment
 
class Aspose::Email::Bounce::BounceDetector
 
class Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions
 
class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Append::EwsClientMessageAppend
 
class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::EwsClientMessageFetch
 
class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::Helpers::ParsedExtendedProperties
 
class Aspose::Email::Clients::Graph::V1::Commands::CreateMailMessageCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::SendMailMessageCommand
 
class Aspose::Email::Clients::Graph::V1::Commands::UpdateMailMessageCommand
 
class Aspose::Email::Clients::Graph::GraphClientV1
 
class Aspose::Email::Clients::Graph::V1::Model::TLMailMessage
 
class Aspose::Email::Clients::Imap::Commands::FetchIncompleteMessageCommand
 
class Aspose::Email::Clients::Imap::Commands::FetchMessageGrCommand
 
class Aspose::Email::Clients::Imap::Commands::FetchMessagesGrCommand
 
class Aspose::Email::Clients::Smtp::Commands::SendGrCommand
 
class Aspose::Email::EmlValidator
 
class Aspose::Email::EvaluationMessageHelper
 
class Aspose::Email::Mapi::MailMessageInterpretor
 
class Aspose::Email::Mapi::ClearSignedMailMessageInterpretor
 
class Aspose::Email::Mapi::DeliveryReportMailMessageInterpretor
 
class Aspose::Email::Mapi::MapiMessageItemInterpretor
 
class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
 
class Aspose::Email::Mapi::MapiMessage
 
class Aspose::Email::MhtMessageFormatter
 
class Aspose::Email::ReadOnlyMailMessage
 
class Aspose::Email::Storage::Mbox::MboxoStorageReader
 
class Aspose::Email::Storage::Mbox::MboxStorageReader
 
class Aspose::Email::Storage::Mbox::MboxrdStorageReader
 
class Aspose::Email::Storage::Mbox::MboxrdStorageWriter
 
class Aspose::Email::Storage::Nsf::Note
 
class Aspose::Email::Storage::Olm::MapiMessageIterator
 
class Aspose::Email::Storage::Olm::OlmStorage
 
class Aspose::Email::Tnef::TnefAttachment
 
class Aspose::Email::Tools::ForwardMessageBuilder
 
class Aspose::Email::Tools::ResponseMessageBuilder
 
class Aspose::Email::Tools::ReplyMessageBuilder
 
class Aspose::Email::Tools::Verifications::MessageValidator
 

Detailed Description

Provides possibility to handle rendering of hyperlink in custom style.

Parameters
source
Returns

Represents an e-mail message. It allows to access message properties, ex. subject, body, sender and recipients addreses, etc. Also it can be sent and delivered by means of supported mail protocols.

The following example shows how to create a new Email Message and save with SaveOptions.

[C#]

{
// Set subject of the message, Html body and sender information
Subject = "New message created by Aspose.Email for .NET",
HtmlBody = "<b>This line is in bold.</b> <br/> <br/>" +
"<font color=blue>This line is in blue color</font>",
From = new MailAddress("from@domain.com", "Sender Name", false)
};
// Add TO recipients and Add CC recipients
message.To.Add(new MailAddress("to1@domain.com", "Recipient 1", false));
message.To.Add(new MailAddress("to2@domain.com", "Recipient 2", false));
message.CC.Add(new MailAddress("cc1@domain.com", "Recipient 3", false));
message.CC.Add(new MailAddress("cc2@domain.com", "Recipient 4", false));
// Save message to EML, EMLX, MSG and MHTML formats
message.Save("CreateNewMailMessage_out.eml", SaveOptions.DefaultEml);
message.Save("CreateNewMailMessage_out.emlx", SaveOptions.CreateSaveOptions(MailMessageSaveType.EmlxFormat));
message.Save("CreateNewMailMessage_out.msg", SaveOptions.DefaultMsgUnicode);
message.Save("CreateNewMailMessage_out.mhtml", SaveOptions.DefaultMhtml);

[Visual Basic]

' Create a new instance of MailMessage class
Dim message As MailMessage = New MailMessage()
' Set subject of the message, Html body and sender information
message.Subject = "New message created by Aspose.Email for .NET"
message.HtmlBody = "<b>This line is in bold.</b> <br/> <br/>" & "<font color=blue>This line is in blue color</font>"
message.From = New MailAddress("from@domain.com", "Sender Name", False)
' Add TO recipients and Add CC recipients
message.[To].Add(New MailAddress("to1@domain.com", "Recipient 1", False))
message.[To].Add(New MailAddress("to2@domain.com", "Recipient 2", False))
message.CC.Add(New MailAddress("cc1@domain.com", "Recipient 3", False))
message.CC.Add(New MailAddress("cc2@domain.com", "Recipient 4", False))
' Save message in EML, EMLX, MSG and MHTML formats
message.Save("CreateNewMailMessage_out.eml", SaveOptions.DefaultEml)
message.Save("CreateNewMailMessage_out.emlx", SaveOptions.CreateSaveOptions(MailMessageSaveType.EmlxFormat))
message.Save("CreateNewMailMessage_out.msg", SaveOptions.DefaultMsgUnicode)
message.Save("CreateNewMailMessage_out.mhtml", SaveOptions.DefaultMhtml)

Constructor & Destructor Documentation

◆ MailMessage() [1/5]

Aspose::Email::MailMessage::MailMessage ( System::String  from,
System::String  to 
)

Initializes a new instance of the MailMessage class

Parameters
fromSender address
toRecipient address

◆ MailMessage() [2/5]

Aspose::Email::MailMessage::MailMessage ( )

Initializes a new instance of the MailMessage class

◆ MailMessage() [3/5]

Aspose::Email::MailMessage::MailMessage ( bool  increaseCredit)

Initializes a new instance of the MailMessage class

◆ MailMessage() [4/5]

Aspose::Email::MailMessage::MailMessage ( System::String  from,
System::String  to,
System::String  subject,
System::String  body 
)

Initializes a new instance of the MailMessage class

Parameters
fromSender address
toRecipient address
subjectMessage subject
bodyMessage body

◆ MailMessage() [5/5]

Aspose::Email::MailMessage::MailMessage ( System::SharedPtr< MailAddress from,
System::SharedPtr< MailAddress to 
)

Initializes a new instance of the MailMessage class

Parameters
fromSender address
toRecipient address

◆ ~MailMessage()

virtual Aspose::Email::MailMessage::~MailMessage ( )
protectedvirtual

Member Function Documentation

◆ AddAlternateView()

virtual void Aspose::Email::MailMessage::AddAlternateView ( System::SharedPtr< AlternateView view)
virtual

Add an alternate view to message

Parameters
viewAlternate view for adding

◆ AddAttachment()

virtual void Aspose::Email::MailMessage::AddAttachment ( System::SharedPtr< Attachment attachment)
virtual

Add an attachment to message

Parameters
attachmentAttachment for adding

The following example shows how to add Attachments to MailMessage.

[C#]

// Create an instance of MailMessage class
var eml = new MailMessage
{
From = "sender@from.com",
To = "receiver@to.com",
Subject = "This is message",
Body = "This is body"
};
// Load an attachment
var attachment = new Attachment("1.txt");
// Add Multiple Attachment in instance of MailMessage class and Save message to disk
eml.Attachments.Add(attachment);
eml.AddAttachment(new Attachment("1.jpg"));
eml.AddAttachment(new Attachment("1.doc"));
eml.AddAttachment(new Attachment("1.rar"));
eml.AddAttachment(new Attachment("1.pdf"));
eml.Save("AddAttachments.eml");

[Visual Basic]

' Create an instance of MailMessage class
Dim eml = New MailMessage With {
.From = "sender@from.com",
.[To] = "receiver@to.com",
.Subject = "This is message",
.Body = "This is body"
}
' Load an attachment
Dim attachment = New Attachment("1.txt")
' Add Multiple Attachment in instance of MailMessage class and Save message to disk
eml.Attachments.Add(attachment)
eml.AddAttachment(New Attachment("1.jpg"))
eml.AddAttachment(New Attachment("1.doc"))
eml.AddAttachment(New Attachment("1.rar"))
eml.AddAttachment(New Attachment("1.pdf"))
eml.Save("AddAttachments.eml")

◆ BuildDeliveryStatusNotificationString()

System::String Aspose::Email::MailMessage::BuildDeliveryStatusNotificationString ( )

◆ CheckBounced()

virtual System::SharedPtr<Bounce::BounceResult> Aspose::Email::MailMessage::CheckBounced ( )
virtual

Checks whether this message can be treated as a bounce message.

Returns
Result of checkingBounceResult.

◆ Clone()

virtual System::SharedPtr<MailMessage> Aspose::Email::MailMessage::Clone ( )
virtual

Clones this instance

Returns
MailMessage that is a copy of the current instance

◆ CreateContentData()

System::ArrayPtr<uint8_t> Aspose::Email::MailMessage::CreateContentData ( System::SharedPtr< System::Collections::Generic::ListExt< System::String >> &  signedBoundaries)

◆ CreateDKIMContentData()

System::ArrayPtr<uint8_t> Aspose::Email::MailMessage::CreateDKIMContentData ( System::SharedPtr< System::Collections::Generic::ListExt< System::String >> &  signedBoundaries)

◆ CreateReadReceipt()

System::SharedPtr<MailMessage> Aspose::Email::MailMessage::CreateReadReceipt ( System::String  from,
System::String  bodyText 
)

Creates the read receipt.

Parameters
fromString that represents the sender address.
bodyTextThe message body text. The default message body text will be applied if this parameter is null or empty.
Returns
A newly created MailMessage that represents the read receipt.

◆ Dispose() [1/2]

void Aspose::Email::MailMessage::Dispose ( )
override

Releases all resources used by the MailMessage

◆ Dispose() [2/2]

virtual void Aspose::Email::MailMessage::Dispose ( bool  disposing)
protectedvirtual

Releases unmanaged and - optionally - managed resources

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

◆ Equals()

bool Aspose::Email::MailMessage::Equals ( System::SharedPtr< System::Object >  obj)
override

Determines whether the specified Object is equal to the current Object.

Parameters
objThe Object to compare with the current Object.
Returns
Returns a boolean indicating if the passed in object obj is Equal to this.

◆ ForceTextContentType()

void Aspose::Email::MailMessage::ForceTextContentType ( )

◆ get_AlternateViews()

virtual System::SharedPtr<AlternateViewCollection> Aspose::Email::MailMessage::get_AlternateViews ( )
virtual

Gets the collection of alternate views of message

◆ get_Attachments()

System::SharedPtr<AttachmentCollection> Aspose::Email::MailMessage::get_Attachments ( )
overridevirtual

Gets the collection of attachments of message

Implements Aspose::Email::IMessage.

◆ get_Bcc()

System::SharedPtr<MailAddressCollection> Aspose::Email::MailMessage::get_Bcc ( )
overridevirtual

Gets the address collection that contains the BCC recipients of message

Implements Aspose::Email::IMessage.

◆ get_Body()

System::String Aspose::Email::MailMessage::get_Body ( )
overridevirtual

Gets the plain text representation of message's body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.

Implements Aspose::Email::IMessage.

◆ get_BodyEncoding()

virtual System::SharedPtr<System::Text::Encoding> Aspose::Email::MailMessage::get_BodyEncoding ( )
virtual

Gets encoding of body

◆ get_BodyType()

Mapi::BodyContentType Aspose::Email::MailMessage::get_BodyType ( )
overridevirtual

Gets the type of the body.

Implements Aspose::Email::IMessage.

◆ get_Categories()

System::ArrayPtr<System::String> Aspose::Email::MailMessage::get_Categories ( ) const

Gets exchange message categories

◆ get_CC()

System::SharedPtr<MailAddressCollection> Aspose::Email::MailMessage::get_CC ( )
overridevirtual

Gets the address collection that contains the CC recipients

Implements Aspose::Email::IMessage.

◆ get_Date()

System::DateTime Aspose::Email::MailMessage::get_Date ( )
overridevirtual

Gets the date of message

Implements Aspose::Email::IMessage.

◆ get_DeliveryNotificationOptions()

virtual Aspose::Email::DeliveryNotificationOptions Aspose::Email::MailMessage::get_DeliveryNotificationOptions ( )
virtual

Gets the delivery notifications

◆ get_Epilogue()

System::String Aspose::Email::MailMessage::get_Epilogue ( )

Gets an epilogue text. It is located after the last boundary.

The string value that represents an epilogue.

◆ get_ExtendedProperties()

System::SharedPtr<System::Collections::Generic::Dictionary<System::SharedPtr<Mapi::PropertyDescriptor>, System::SharedPtr<System::Object> > > Aspose::Email::MailMessage::get_ExtendedProperties ( ) const

Gets extended properties of a message.

◆ get_From()

System::SharedPtr<MailAddress> Aspose::Email::MailMessage::get_From ( )
overridevirtual

Gets the from address

Implements Aspose::Email::IMessage.

◆ get_Headers()

virtual System::SharedPtr<Mime::HeaderCollection> Aspose::Email::MailMessage::get_Headers ( )
virtual

Gets headers collection of message

◆ get_HtmlBody()

System::String Aspose::Email::MailMessage::get_HtmlBody ( )
overridevirtual

Gets html body

Implements Aspose::Email::IMessage.

◆ get_IsBodyHtml()

virtual bool Aspose::Email::MailMessage::get_IsBodyHtml ( )
virtual

Gets a value indicating whether the message body is in Html

◆ get_IsDraft()

virtual bool Aspose::Email::MailMessage::get_IsDraft ( )
virtual

Gets value that indicates whether or not a message has been sent.

◆ get_IsEmpty()

bool Aspose::Email::MailMessage::get_IsEmpty ( )

◆ get_IsEncrypted()

virtual bool Aspose::Email::MailMessage::get_IsEncrypted ( )
virtual

Gets a value indicating whether the message is encrypted.

◆ get_IsRead()

bool Aspose::Email::MailMessage::get_IsRead ( )

◆ get_IsReadOnly()

virtual bool Aspose::Email::MailMessage::get_IsReadOnly ( )
virtual

Gets a value indicating whether the message is read only

◆ get_IsSigned()

virtual bool Aspose::Email::MailMessage::get_IsSigned ( )
virtual

Gets a value indicating whether the message is signed.

◆ get_ItemId()

virtual System::SharedPtr<MailboxInfo> Aspose::Email::MailMessage::get_ItemId ( )
virtual

Represents identification information about message in a mailbox.

◆ get_LinkedResources()

virtual System::SharedPtr<LinkedResourceCollection> Aspose::Email::MailMessage::get_LinkedResources ( )
virtual

Gets the collection of linked resources of message

◆ get_ListUnsubscribe()

System::String Aspose::Email::MailMessage::get_ListUnsubscribe ( )

The List-Unsubscribe field describes the command (preferably using mail) to directly unsubscribe the user(removing them from the list). For more details please see https://tools.ietf.org/html/rfc2369

◆ get_Message()

System::SharedPtr<Aspose::Email::Message> Aspose::Email::MailMessage::get_Message ( ) const

◆ get_MessageId()

virtual System::String Aspose::Email::MailMessage::get_MessageId ( )
virtual

Gets the message id

◆ get_OriginalIsTnef()

virtual bool Aspose::Email::MailMessage::get_OriginalIsTnef ( )
virtual

Gets a value indicating whether original EML message is in TNEF format.

◆ get_Preamble()

System::String Aspose::Email::MailMessage::get_Preamble ( )

Gets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.

The string value that represents a preamble.

◆ get_PreferredTextEncoding()

System::SharedPtr<System::Text::Encoding> Aspose::Email::MailMessage::get_PreferredTextEncoding ( )
overridevirtual

Gets preferred encoding for all text properties

Implements Aspose::Email::IPreferredTextEncodingProvider.

◆ get_PreserveTnefAttachment()

bool Aspose::Email::MailMessage::get_PreserveTnefAttachment ( ) const

Controls TNEF attachment load/save behaviour

◆ get_Priority()

virtual MailPriority Aspose::Email::MailMessage::get_Priority ( )
virtual

Gets the priority of message

◆ get_ReadReceiptRequested()

bool Aspose::Email::MailMessage::get_ReadReceiptRequested ( ) const

◆ get_ReadReceiptTo()

System::SharedPtr<MailAddressCollection> Aspose::Email::MailMessage::get_ReadReceiptTo ( )

Gets the read receipt address.

The MailAddressCollection that represents

◆ get_ReplyToList()

virtual System::SharedPtr<MailAddressCollection> Aspose::Email::MailMessage::get_ReplyToList ( )
virtual

Gets the list of addresses to reply to for the mail message

◆ get_ReversePath()

virtual System::SharedPtr<MailAddress> Aspose::Email::MailMessage::get_ReversePath ( )
virtual

Gets ReversePath address

◆ get_Sender()

virtual System::SharedPtr<MailAddress> Aspose::Email::MailMessage::get_Sender ( )
virtual

Gets sender address

◆ get_Sensitivity()

virtual MailSensitivity Aspose::Email::MailMessage::get_Sensitivity ( )
virtual

Gets the sensitivity of message

◆ get_Subject()

System::String Aspose::Email::MailMessage::get_Subject ( )
overridevirtual

Gets the subject line

Implements Aspose::Email::IMessage.

◆ get_SubjectEncoding()

virtual System::SharedPtr<System::Text::Encoding> Aspose::Email::MailMessage::get_SubjectEncoding ( )
virtual

Gets the encoding of subject

◆ get_SuppressBcc()

bool Aspose::Email::MailMessage::get_SuppressBcc ( )

Indicates whether Bcc header is suppressed in MIME.

◆ get_TimeZoneOffset()

System::TimeSpan Aspose::Email::MailMessage::get_TimeZoneOffset ( )

Gets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC.

◆ get_TnefAttachment()

System::SharedPtr<Aspose::Email::Tnef::TnefAttachment> Aspose::Email::MailMessage::get_TnefAttachment ( ) const

Gets the tnef attachment.

The tnef attachment.

◆ get_To()

System::SharedPtr<MailAddressCollection> Aspose::Email::MailMessage::get_To ( )
overridevirtual

Gets the address collection that contains the recipients of message

Implements Aspose::Email::IMessage.

◆ get_VentLicense()

System::SharedPtr<System::Object> Aspose::Email::MailMessage::get_VentLicense ( ) const

This stores the venture licensing state instead of 2 obvious fields such as string value for watermark and some value indicating license is set or not.

◆ get_XMailer()

virtual System::String Aspose::Email::MailMessage::get_XMailer ( )
virtual

Gets the X-Mailer the software that created the e-mail message

◆ GetAlternateViewContent()

System::String Aspose::Email::MailMessage::GetAlternateViewContent ( System::String  mediaType)

Gets the content as a string from the specified AlternateView.

Parameters
mediaTypeMediaType of needed AlternateView.
Returns

◆ GetEmlStream()

static System::SharedPtr<System::IO::MemoryStream> Aspose::Email::MailMessage::GetEmlStream ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< System::Collections::Generic::ListExt< uint8_t >> &  headerBytes 
)
static

◆ GetHashCode()

int32_t Aspose::Email::MailMessage::GetHashCode ( ) const
override

Returns a hash code for object

Returns

◆ GetHeadersAsString()

System::String Aspose::Email::MailMessage::GetHeadersAsString ( )

◆ GetHtmlBodyText() [1/2]

virtual System::String Aspose::Email::MailMessage::GetHtmlBodyText ( bool  showUrl)
virtual

Gets the message html body as plain text. This method parses the HtmlBody property and returns plain text content ignoring the html markup.

Parameters
showUrlDefines need to show URL in text.

The following example shows how to get an email message�s HTML body as plain text.

[C#]

var eml = MailMessage.Load("HtmlWithUrlSample.eml");
var bodyWithUrl = eml.GetHtmlBodyText(true);// body will contain URL
var bodyWithoutUrl = eml.GetHtmlBodyText(false);// body will not contain URL
Console.WriteLine($@"Body with URL: {bodyWithUrl}");
Console.WriteLine($@"Body without URL: {bodyWithoutUrl}");

[Visual Basic]

Dim eml = MailMessage.Load("HtmlWithUrlSample.eml")
Dim bodyWithUrl = eml.GetHtmlBodyText(True)
Dim bodyWithoutUrl = eml.GetHtmlBodyText(False)
Console.WriteLine($"Body with URL: {bodyWithUrl}")
Console.WriteLine($"Body without URL: {bodyWithoutUrl}")

◆ GetHtmlBodyText() [2/2]

virtual System::String Aspose::Email::MailMessage::GetHtmlBodyText ( Common::Transform::HyperlinkRenderingCallback  hyperlinkRenderingCallback)
virtual

Gets the message htmlbody as plain text.

Parameters
hyperlinkRenderingCallbackReference to custom method for handling rendering of hyperlink.
Returns
Result string of custom handling rendering of hyperlink.

◆ GetHtmlView()

System::SharedPtr<AlternateView> Aspose::Email::MailMessage::GetHtmlView ( )

◆ GetLinkedResourceCount()

int32_t Aspose::Email::MailMessage::GetLinkedResourceCount ( )

Gets the count of message linked resources and alternative view linked resourced.

Returns
A count of all linked resources

◆ GetTextPlainView()

System::SharedPtr<AlternateView> Aspose::Email::MailMessage::GetTextPlainView ( )

◆ Import()

virtual void Aspose::Email::MailMessage::Import ( System::SharedPtr< System::IO::Stream >  stream)
virtual

Populates a T:System::Runtime::Serialization::SerializationInfo with the data needed to serialize the target object.

Parameters
infoThe T:System::Runtime::Serialization::SerializationInfo to populate with data.
contextThe destination (see T:System::Runtime::Serialization::StreamingContext) for this serialization.
Exceptions
T:System::Security::SecurityExceptionThe caller does not have the required permission.

◆ ImportHeaders() [1/2]

void Aspose::Email::MailMessage::ImportHeaders ( System::SharedPtr< Aspose::Email::Message >  message)

◆ ImportHeaders() [2/2]

void Aspose::Email::MailMessage::ImportHeaders ( System::SharedPtr< System::IO::Stream >  stream)

◆ ListAttachmentBase()

System::SharedPtr<System::Collections::Generic::ListExt<System::SharedPtr<AttachmentBase> > > Aspose::Email::MailMessage::ListAttachmentBase ( )

◆ Load() [1/4]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::Load ( System::SharedPtr< System::IO::Stream >  stream)
static

Load message from stream

Parameters
streamStream that represents message in eml or msg format
Returns
E-mail message

◆ Load() [2/4]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::Load ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< LoadOptions options 
)
static

Load message from stream with additional options.

Parameters
streamSource streamSystem::IO::Stream.
optionsAdditional options LoadOptions.
Returns
Mail messageMailMessage.
Exceptions
ArgumentNullExceptionIf stream is null.

◆ Load() [3/4]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::Load ( System::String  fileName)
static

Load message from file

Parameters
fileNameMessage file name. The message file must be in eml or msg format.
Returns
E-mail message

◆ Load() [4/4]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::Load ( System::String  fileName,
System::SharedPtr< LoadOptions options 
)
static

Load message from file with additional options.

Parameters
fileNameSource file pathSystem::String.
optionsAdditional options LoadOptions.
Returns
Mail messageMailMessage.
Exceptions
ArgumentNullExceptionIf fileName is null.

The following example shows how to load a Message with Load Options.

[C#]

// Load Eml, html, mhtml, msg and dat file
MailMessage.Load("Message.eml", new EmlLoadOptions());
MailMessage.Load("description.html", new HtmlLoadOptions());
MailMessage.Load("Message.mhtml", new MhtmlLoadOptions());
MailMessage.Load("Message.msg", new MsgLoadOptions());
// loading with custom options
var emlLoadOptions = new EmlLoadOptions
{
PreferredTextEncoding = Encoding.UTF8,
};
MailMessage.Load("description.html", emlLoadOptions);
var htmlLoadOptions = new HtmlLoadOptions
{
PreferredTextEncoding = Encoding.UTF8,
ShouldAddPlainTextView = true,
PathToResources = htmlImagesFolder
};
MailMessage.Load("description.html", htmlLoadOptions);

[Visual Basic]

' Load Eml, html, mhtml, msg and dat file
Dim mailMessage As MailMessage = MailMessage.Load("Message.eml", New EmlLoadOptions())
MailMessage.Load("description.html", New HtmlLoadOptions())
MailMessage.Load("Message.mhtml", New MhtmlLoadOptions())
MailMessage.Load("Message.msg", New MsgLoadOptions())
' loading with custom options
Dim emlLoadOptions As EmlLoadOptions = New EmlLoadOptions With {
.PrefferedTextEncoding = Encoding.UTF8,
.PreserveTnefAttachments = True
}
MailMessage.Load("description.html", emlLoadOptions)
Dim htmlLoadOptions As HtmlLoadOptions = New HtmlLoadOptions With {
.PrefferedTextEncoding = Encoding.UTF8,
.ShouldAddPlainTextView = True,
.PathToResources = htmlImagesFolder
}
MailMessage.Load("description.html", emlLoadOptions)

◆ LoadInternal() [1/2]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::LoadInternal ( System::SharedPtr< System::IO::Stream >  stream)
static

Load message from stream. NOTE!!! Call this method if you don't need to increase customer consumption credit for Dynabic.Metered.

Parameters
streamStream that represents message in eml or msg format
Returns
E-mail message

◆ LoadInternal() [2/2]

static System::SharedPtr<MailMessage> Aspose::Email::MailMessage::LoadInternal ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< LoadOptions options 
)
static

Load message from stream with additional options. NOTE!!! Call this method if you don't need to increase customer consumption credit for Dynabic.Metered.

Parameters
streamSource streamSystem::IO::Stream.
optionsAdditional options LoadOptions.
Returns
Mail messageMailMessage.
Exceptions
ArgumentNullExceptionIf stream is null.

◆ LoadMessageStructure()

void Aspose::Email::MailMessage::LoadMessageStructure ( System::SharedPtr< Clients::Imap::Commands::BodyStructureMultiPart >  bodyStructure,
System::SharedPtr< Clients::Imap::Commands::BodyStructurePart > &  textBodyPart,
System::SharedPtr< Clients::Imap::Commands::BodyStructurePart > &  htmlBodyPart 
)

Loads the message structure and search text body and html body parts' indexes

Parameters
bodyStructureA BodyStructureMultiPart containing the message structure
textBodyPartAn index of found text body
htmlBodyPartAn index of found html body

◆ OnConversionProgress()

void Aspose::Email::MailMessage::OnConversionProgress ( System::SharedPtr< ProgressEventHandlerInfo info)

◆ RecomposeTnefContent()

void Aspose::Email::MailMessage::RecomposeTnefContent ( )

Composes the TNEF content. Note, that tnef attachment is composed if a message initially contained TNEF and was loaded without FileCompatibilityMode.PreserveTnefAttachments flag, That is this method doesn't create tnef message out of the regular one.

◆ Replace()

void Aspose::Email::MailMessage::Replace ( System::String  mediaType,
System::SharedPtr< AlternateView view 
)

◆ Save() [1/4]

void Aspose::Email::MailMessage::Save ( System::SharedPtr< System::IO::Stream >  stream)
overridevirtual

Save message as a stream

Parameters
streamStream into which message is saved

Implements Aspose::Email::IMessage.

◆ Save() [2/4]

virtual void Aspose::Email::MailMessage::Save ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< SaveOptions options 
)
virtual

Save message as a stream with additional options.

Parameters
streamStream into which message is saved.
optionsAdditional options for savingSaveOptions.

Reimplemented in Aspose::Email::Amp::AmpMessage.

◆ Save() [3/4]

void Aspose::Email::MailMessage::Save ( System::String  fileName)
overridevirtual

Save message as a file

Parameters
fileNameName of a file to save message.

Implements Aspose::Email::IMessage.

◆ Save() [4/4]

virtual void Aspose::Email::MailMessage::Save ( System::String  fileName,
System::SharedPtr< SaveOptions options 
)
virtual

Save message as a file with additional options.

Parameters
fileNameStream into which message is saved.
optionsAdditional options for savingSaveOptions.

The following example shows how to save an email message as HTML with embedded images.

[C#]

var fileName = "EmailWithAttachEmbedded.eml";
var eml = MailMessage.Load(fileName);
var options = new HtmlSaveOptions()
{
};
eml.Save($"{fileName}.html", options);

[Visual Basic]

Dim fileName = "EmailWithAttachEmbedded.eml"
Dim eml = MailMessage.Load(fileName)
Dim options = New HtmlSaveOptions() With {
.ResourceRenderingMode = ResourceRenderingMode.EmbedIntoHtml
}
eml.Save($"{fileName}.html", options)

◆ Send()

void Aspose::Email::MailMessage::Send ( System::SharedPtr< Mime::BaseWriter >  writer,
System::SharedPtr< ProgressEventHandlerInfo progressInfo 
)

◆ set_Bcc()

virtual void Aspose::Email::MailMessage::set_Bcc ( System::SharedPtr< MailAddressCollection value)
virtual

Sets the address collection that contains the BCC recipients of message

◆ set_Body()

void Aspose::Email::MailMessage::set_Body ( System::String  value)
overridevirtual

Sets the plain text representation of message's body. If the text/plain part is present in a message, the propery returns its text data. Otherwise, property returns the text content of the HtmlBody property without html markup.

Implements Aspose::Email::IMessage.

◆ set_BodyEncoding()

virtual void Aspose::Email::MailMessage::set_BodyEncoding ( System::SharedPtr< System::Text::Encoding >  value)
virtual

Sets encoding of body

◆ set_Categories()

void Aspose::Email::MailMessage::set_Categories ( System::ArrayPtr< System::String >  value)

Sets exchange message categories

◆ set_CC()

virtual void Aspose::Email::MailMessage::set_CC ( System::SharedPtr< MailAddressCollection value)
virtual

Sets the address collection that contains the CC recipients

◆ set_Date()

virtual void Aspose::Email::MailMessage::set_Date ( System::DateTime  value)
virtual

Sets the date of message

◆ set_DeliveryNotificationOptions()

virtual void Aspose::Email::MailMessage::set_DeliveryNotificationOptions ( Aspose::Email::DeliveryNotificationOptions  value)
virtual

Sets the delivery notifications

◆ set_Epilogue()

void Aspose::Email::MailMessage::set_Epilogue ( System::String  value)

Sets an epilogue text. It is located after the last boundary.

The string value that represents an epilogue.

◆ set_From() [1/2]

void Aspose::Email::MailMessage::set_From ( System::SharedPtr< MailAddress value)
overridevirtual

Sets the from address

Implements Aspose::Email::IMessage.

◆ set_From() [2/2]

virtual void Aspose::Email::MailMessage::set_From ( System::String  value)
virtual

◆ set_HtmlBody()

void Aspose::Email::MailMessage::set_HtmlBody ( System::String  value)
overridevirtual

Sets html body

Implements Aspose::Email::IMessage.

◆ set_IsBodyHtml()

virtual void Aspose::Email::MailMessage::set_IsBodyHtml ( bool  value)
virtual

Sets a value indicating whether the message body is in Html

◆ set_IsDraft()

virtual void Aspose::Email::MailMessage::set_IsDraft ( bool  value)
virtual

Sets value that indicates whether or not a message has been sent.

◆ set_ItemId()

virtual void Aspose::Email::MailMessage::set_ItemId ( System::SharedPtr< MailboxInfo value)
virtual

Represents identification information about message in a mailbox.

◆ set_ListUnsubscribe()

void Aspose::Email::MailMessage::set_ListUnsubscribe ( System::String  value)

The List-Unsubscribe field describes the command (preferably using mail) to directly unsubscribe the user(removing them from the list). For more details please see https://tools.ietf.org/html/rfc2369

◆ set_MessageId()

virtual void Aspose::Email::MailMessage::set_MessageId ( System::String  value)
virtual

Sets the message id

◆ set_Preamble()

void Aspose::Email::MailMessage::set_Preamble ( System::String  value)

Sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.

The string value that represents a preamble.

◆ set_PreferredTextEncoding()

void Aspose::Email::MailMessage::set_PreferredTextEncoding ( System::SharedPtr< System::Text::Encoding >  value)
overridevirtual

Sets preferred encoding for all text properties

Implements Aspose::Email::IPreferredTextEncodingProvider.

◆ set_PreserveTnefAttachment()

void Aspose::Email::MailMessage::set_PreserveTnefAttachment ( bool  value)

Controls TNEF attachment load/save behaviour

◆ set_Priority()

virtual void Aspose::Email::MailMessage::set_Priority ( MailPriority  value)
virtual

Sets the priority of message

◆ set_ReadReceiptRequested()

void Aspose::Email::MailMessage::set_ReadReceiptRequested ( bool  value)

◆ set_ReadReceiptTo() [1/2]

void Aspose::Email::MailMessage::set_ReadReceiptTo ( System::SharedPtr< MailAddressCollection value)

Sets the read receipt address.

The MailAddressCollection that represents

◆ set_ReadReceiptTo() [2/2]

virtual void Aspose::Email::MailMessage::set_ReadReceiptTo ( System::String  value)
virtual

◆ set_ReplyToList() [1/3]

virtual void Aspose::Email::MailMessage::set_ReplyToList ( System::SharedPtr< MailAddress value)
virtual

◆ set_ReplyToList() [2/3]

virtual void Aspose::Email::MailMessage::set_ReplyToList ( System::SharedPtr< MailAddressCollection value)
virtual

Sets the list of addresses to reply to for the mail message

◆ set_ReplyToList() [3/3]

virtual void Aspose::Email::MailMessage::set_ReplyToList ( System::String  value)
virtual

◆ set_ReversePath()

virtual void Aspose::Email::MailMessage::set_ReversePath ( System::SharedPtr< MailAddress value)
virtual

Sets ReversePath address

◆ set_Sender() [1/2]

virtual void Aspose::Email::MailMessage::set_Sender ( System::SharedPtr< MailAddress value)
virtual

Sets sender address

◆ set_Sender() [2/2]

virtual void Aspose::Email::MailMessage::set_Sender ( System::String  value)
virtual

◆ set_Sensitivity()

virtual void Aspose::Email::MailMessage::set_Sensitivity ( MailSensitivity  value)
virtual

Sets the sensitivity of message

◆ set_Subject()

void Aspose::Email::MailMessage::set_Subject ( System::String  value)
overridevirtual

Sets the subject line

Implements Aspose::Email::IMessage.

◆ set_SubjectEncoding()

virtual void Aspose::Email::MailMessage::set_SubjectEncoding ( System::SharedPtr< System::Text::Encoding >  value)
virtual

Sets the encoding of subject

◆ set_SuppressBcc()

void Aspose::Email::MailMessage::set_SuppressBcc ( bool  value)

Indicates whether Bcc header is suppressed in MIME.

◆ set_TimeZoneOffset()

void Aspose::Email::MailMessage::set_TimeZoneOffset ( System::TimeSpan  value)

Sets the Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC.

◆ set_TnefAttachment()

void Aspose::Email::MailMessage::set_TnefAttachment ( System::SharedPtr< Aspose::Email::Tnef::TnefAttachment >  value)

Gets the tnef attachment.

The tnef attachment.

◆ set_To() [1/3]

virtual void Aspose::Email::MailMessage::set_To ( System::SharedPtr< MailAddress value)
virtual

◆ set_To() [2/3]

virtual void Aspose::Email::MailMessage::set_To ( System::SharedPtr< MailAddressCollection value)
virtual

Sets the address collection that contains the recipients of message

◆ set_To() [3/3]

virtual void Aspose::Email::MailMessage::set_To ( System::String  value)
virtual

◆ set_XMailer()

virtual void Aspose::Email::MailMessage::set_XMailer ( System::String  value)
virtual

Sets the X-Mailer the software that created the e-mail message

◆ SetContent()

System::SharedPtr<System::Collections::Generic::ListExt<System::String> > Aspose::Email::MailMessage::SetContent ( )

◆ SetHtmlBody()

virtual void Aspose::Email::MailMessage::SetHtmlBody ( System::String  value,
bool  detectEncoding 
)
virtual

Sets html body.

Parameters
valueThe HtmlBody content text.
detectEncodingDetect body encoding if no encoding is specified for the MailMessage.

◆ SetMessageId()

void Aspose::Email::MailMessage::SetMessageId ( System::String  value)

◆ SetVentureLicense()

void Aspose::Email::MailMessage::SetVentureLicense ( System::SharedPtr< System::Object >  ventureLicense)

All Aspose products should implement this method. It is called by a GroupDocs product to indicate whether GroupDocs itself is licensed or not and specify a custom watermark. When GroupDocs is licensed, this document instance should behave as licensed too even if the Aspose product is not licensed.

◆ ToString()

System::String Aspose::Email::MailMessage::ToString ( ) const
override

Returns a string that represents the current object.

Returns
A string that represents the current object.

◆ TryGetEncodingFromHtmlBody()

static System::SharedPtr<System::Text::Encoding> Aspose::Email::MailMessage::TryGetEncodingFromHtmlBody ( System::String  htmlBody)
static

◆ ValidateMessage() [1/2]

static System::SharedPtr<EmlValidationErrorCollection> Aspose::Email::MailMessage::ValidateMessage ( System::SharedPtr< System::IO::Stream >  stream)
static

Validate eml message for corresponding to mime specification.

Deprecated:
This method is marked as obsolete and will be removed soon.Use Aspose.Email.MessageValidator.Validate instead.
Parameters
streamA stream containing the message in eml format.
Exceptions
ArgumentNullExceptionstream is null.
Returns
A EmlValidationErrorCollection containing the found validation error messages.

◆ ValidateMessage() [2/2]

static System::SharedPtr<EmlValidationErrorCollection> Aspose::Email::MailMessage::ValidateMessage ( System::String  fileName)
static

Validate eml message for corresponding to mime specification.

Deprecated:
This method is marked as obsolete and will be removed soon.Use Aspose.Email.MessageValidator.Validate instead.
Parameters
fileNameA file name (eml).
Exceptions
ArgumentExceptionfileName is null or empty.
FileNotFoundExceptionThe specified fileName doesn't exist.
Returns
A EmlValidationErrorCollection containing the found validation error messages.

Friends And Related Function Documentation

◆ Aspose::Email::Attachment

friend class Aspose::Email::Attachment
friend

◆ Aspose::Email::Bounce::BounceDetector

friend class Aspose::Email::Bounce::BounceDetector
friend

◆ Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions

friend class Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions
friend

◆ Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Append::EwsClientMessageAppend

friend class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Append::EwsClientMessageAppend
friend

◆ Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::EwsClientMessageFetch

friend class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::EwsClientMessageFetch
friend

◆ Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::Helpers::ParsedExtendedProperties

friend class Aspose::Email::Clients::Exchange::WebService::Implementation::Messages::Fetch::Helpers::ParsedExtendedProperties
friend

◆ Aspose::Email::Clients::Graph::GraphClientV1

friend class Aspose::Email::Clients::Graph::GraphClientV1
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::CreateMailMessageCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::CreateMailMessageCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::SendMailMessageCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::SendMailMessageCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::UpdateMailMessageCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::UpdateMailMessageCommand
friend

◆ Aspose::Email::Clients::Graph::V1::Model::TLMailMessage

friend class Aspose::Email::Clients::Graph::V1::Model::TLMailMessage
friend

◆ Aspose::Email::Clients::Imap::Commands::FetchIncompleteMessageCommand

friend class Aspose::Email::Clients::Imap::Commands::FetchIncompleteMessageCommand
friend

◆ Aspose::Email::Clients::Imap::Commands::FetchMessageGrCommand

friend class Aspose::Email::Clients::Imap::Commands::FetchMessageGrCommand
friend

◆ Aspose::Email::Clients::Imap::Commands::FetchMessagesGrCommand

friend class Aspose::Email::Clients::Imap::Commands::FetchMessagesGrCommand
friend

◆ Aspose::Email::Clients::Smtp::Commands::SendGrCommand

friend class Aspose::Email::Clients::Smtp::Commands::SendGrCommand
friend

◆ Aspose::Email::EmlValidator

friend class Aspose::Email::EmlValidator
friend

◆ Aspose::Email::EvaluationMessageHelper

friend class Aspose::Email::EvaluationMessageHelper
friend

◆ Aspose::Email::Mapi::ClearSignedMailMessageInterpretor

friend class Aspose::Email::Mapi::ClearSignedMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::DeliveryReportMailMessageInterpretor

friend class Aspose::Email::Mapi::DeliveryReportMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::MailMessageInterpretor

friend class Aspose::Email::Mapi::MailMessageInterpretor
friend

◆ Aspose::Email::Mapi::MapiMessage

friend class Aspose::Email::Mapi::MapiMessage
friend

◆ Aspose::Email::Mapi::MapiMessageItemInterpretor

friend class Aspose::Email::Mapi::MapiMessageItemInterpretor
friend

◆ Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor

friend class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
friend

◆ Aspose::Email::MhtMessageFormatter

friend class Aspose::Email::MhtMessageFormatter
friend

◆ Aspose::Email::ReadOnlyMailMessage

friend class Aspose::Email::ReadOnlyMailMessage
friend

◆ Aspose::Email::Storage::Mbox::MboxoStorageReader

◆ Aspose::Email::Storage::Mbox::MboxrdStorageReader

◆ Aspose::Email::Storage::Mbox::MboxrdStorageWriter

◆ Aspose::Email::Storage::Mbox::MboxStorageReader

◆ Aspose::Email::Storage::Nsf::Note

friend class Aspose::Email::Storage::Nsf::Note
friend

◆ Aspose::Email::Storage::Olm::MapiMessageIterator

friend class Aspose::Email::Storage::Olm::MapiMessageIterator
friend

◆ Aspose::Email::Storage::Olm::OlmStorage

◆ Aspose::Email::Tnef::TnefAttachment

friend class Aspose::Email::Tnef::TnefAttachment
friend

◆ Aspose::Email::Tools::ForwardMessageBuilder

◆ Aspose::Email::Tools::ReplyMessageBuilder

◆ Aspose::Email::Tools::ResponseMessageBuilder

◆ Aspose::Email::Tools::Verifications::MessageValidator

friend class Aspose::Email::Tools::Verifications::MessageValidator
friend

Member Data Documentation

◆ attachments

System::SharedPtr<AttachmentCollection> Aspose::Email::MailMessage::attachments

◆ body

System::String Aspose::Email::MailMessage::body

◆ bodyEncoding

System::SharedPtr<System::Text::Encoding> Aspose::Email::MailMessage::bodyEncoding

◆ bodyHtml

System::String Aspose::Email::MailMessage::bodyHtml

◆ boundaries

System::SharedPtr<System::Collections::Generic::ListExt<System::String> > Aspose::Email::MailMessage::boundaries

◆ ConversionProgressEvent

System::Event<void(System::SharedPtr<ProgressEventHandlerInfo>)> Aspose::Email::MailMessage::ConversionProgressEvent

Event to notify user about progress of conversion/saving.

◆ deliveryStatusNotification

Aspose::Email::DeliveryNotificationOptions Aspose::Email::MailMessage::deliveryStatusNotification

◆ disposed

bool Aspose::Email::MailMessage::disposed

◆ isBodyHtml

bool Aspose::Email::MailMessage::isBodyHtml

◆ isProcessedByMboxrdStorageWriter

bool Aspose::Email::MailMessage::isProcessedByMboxrdStorageWriter

The property is true, if the current message is processed by a MboxrdStorageWriter. See EMAILNET-38895 and EMAILNET-39005

◆ linkedResources

System::SharedPtr<LinkedResourceCollection> Aspose::Email::MailMessage::linkedResources

◆ message

System::SharedPtr<Aspose::Email::Message> Aspose::Email::MailMessage::message

◆ views

System::SharedPtr<AlternateViewCollection> Aspose::Email::MailMessage::views
ResourceRenderingMode
Provides set various modes of rendering resources in html.
Definition: ResourceRenderingMode.h:16
void Save(System::String fileName) override
Save message as a file
MailMessage()
Initializes a new instance of the MailMessage class
System::String body
Definition: MailMessage.h:417
static System::SharedPtr< MailMessage > Load(System::String fileName)
Load message from file
@ None
No values are set.
System::SharedPtr< Aspose::Email::Message > message
Definition: MailMessage.h:422
@ Arrival
By internal date and time of the message. This differs from the ON criteria in SEARCH,...
@ Text
The plain text.