MimeMessage
Overview
The MimeMessage class, along with the MessagePart and MessageHeader classes, implements the MIME in the Internet Pack library.
This class can be used to parse server response that contains encoded e-mail message.
It is also used in Data Abstract for .NET OData Publishing (.NET) implementation for batch updates processing.
The MimeMessage class represents the root of an email message tree structure. Each email message contains the MIME message headers such as:
- To
- From
- Subject
- Content-Type
- Message-ID
that can be found in the Headers property.
The MessagePart property provides access to the actual content of the MIME message.
Location
-
Reference:
- RemObjects.InternetPack.dll .NET, .NET Core 5.0, .NET Standard 2.0
- RemObjects.InternetPack.fx Island
- libRemObjects.InternetPack.fx Toffee
- Namespace: RemObjects.InternetPack.Messages.Mime
constructor
Creates new empty instance of the MimeMessage class.
constructor
MimeMessage()
init()
Sub New()
constructor (array of Byte)
Creates new instance of the MimeMessage class and loads provided raw message content into it.
constructor(rawMessageContent: array of Byte)
MimeMessage(Byte[] rawMessageContent)
init(_ rawMessageContent: Byte...)
Sub New(rawMessageContent As Byte())
Parameters:
- rawMessageContent: Raw MIME message content
Creates new instance of the MimeMessage class and loads provided raw message content into it.
If the parseBody parameter's value is false then only the message's header is parsed, leaving the message body empty.
constructor(rawMessageContent: array of Byte; parseBody: Boolean)
MimeMessage(Byte[] rawMessageContent, Boolean parseBody)
init(_ rawMessageContent: Byte..., _ parseBody: Boolean)
Sub New(rawMessageContent As Byte(), parseBody As Boolean)
Parameters:
- rawMessageContent: Raw MIME message content
- parseBody: Flag indicating whether the message body should be parsed
Headers virtual
Gets or sets MIME message headers collection.
property Headers: MessageHeader read write;
MessageHeader Headers { get; set; }
var Headers: MessageHeader { get{} set{} }
Property Headers() As MessageHeader
MessagePart virtual
Gets message body.
If the body was parsed for the current message this property will never be null.
property MessagePart: MessagePart read write;
MessagePart MessagePart { get; set; }
var MessagePart: MessagePart { get{} set{} }
Property MessagePart() As MessagePart
RawMessage virtual
Gets the raw message content, including both MIME headers and encoded body.
This property can be persisted and used later to rectreate the message.
property RawMessage: array of Byte read write;
Byte[] RawMessage { get; set; }
var RawMessage: Byte... { get{} set{} }
Property RawMessage() As Byte()
ToHttpResponseBody virtual
Dumps the message contents of its message parts to a raw string.
method ToHttpResponseBody(sb: StringBuilder)
void ToHttpResponseBody(StringBuilder sb)
func ToHttpResponseBody(_ sb: StringBuilder)
Sub ToHttpResponseBody(sb As StringBuilder)
Parameters:
- sb: StringBuilder instance that will contain the persisted message
Headers virtual
Gets or sets MIME message headers collection.
property Headers: MessageHeader read write;
MessageHeader Headers { get; set; }
var Headers: MessageHeader { get{} set{} }
Property Headers() As MessageHeader
MessagePart virtual
Gets message body.
If the body was parsed for the current message this property will never be null.
property MessagePart: MessagePart read write;
MessagePart MessagePart { get; set; }
var MessagePart: MessagePart { get{} set{} }
Property MessagePart() As MessagePart
RawMessage virtual
Gets the raw message content, including both MIME headers and encoded body.
This property can be persisted and used later to rectreate the message.
property RawMessage: array of Byte read write;
Byte[] RawMessage { get; set; }
var RawMessage: Byte... { get{} set{} }
Property RawMessage() As Byte()
constructor
Creates new empty instance of the MimeMessage class.
constructor
MimeMessage()
init()
Sub New()
constructor (array of Byte)
Creates new instance of the MimeMessage class and loads provided raw message content into it.
constructor(rawMessageContent: array of Byte)
MimeMessage(Byte[] rawMessageContent)
init(_ rawMessageContent: Byte...)
Sub New(rawMessageContent As Byte())
Parameters:
- rawMessageContent: Raw MIME message content
Creates new instance of the MimeMessage class and loads provided raw message content into it.
If the parseBody parameter's value is false then only the message's header is parsed, leaving the message body empty.
constructor(rawMessageContent: array of Byte; parseBody: Boolean)
MimeMessage(Byte[] rawMessageContent, Boolean parseBody)
init(_ rawMessageContent: Byte..., _ parseBody: Boolean)
Sub New(rawMessageContent As Byte(), parseBody As Boolean)
Parameters:
- rawMessageContent: Raw MIME message content
- parseBody: Flag indicating whether the message body should be parsed
ToHttpResponseBody virtual
Dumps the message contents of its message parts to a raw string.
method ToHttpResponseBody(sb: StringBuilder)
void ToHttpResponseBody(StringBuilder sb)
func ToHttpResponseBody(_ sb: StringBuilder)
Sub ToHttpResponseBody(sb As StringBuilder)
Parameters:
- sb: StringBuilder instance that will contain the persisted message
- Internet Pack
- MessageHeader
- MessagePart
- MIME
- OData Publishing (.NET)