• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class MimeMessage

A complete MIME message (RFC 5322). Immutable after parsing. Construct via MimeMessageBuilder for writing.

Inheritance
object
MimeMessage
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Mime
Assembly: DRIT.Mail.dll
Syntax
public sealed class MimeMessage

Constructors

View Source

MimeMessage(MimeHeaderCollection, MimeEntity, string?, InternetAddressList, InternetAddressList, InternetAddressList, InternetAddressList, InternetAddressList, string?, DateTimeOffset?, string?, string?, string?, string?, IReadOnlyList<MimeAttachment>)

Initializes a new instance of the MimeMessage class.

Declaration
public MimeMessage(MimeHeaderCollection headers, MimeEntity body, string? subject, InternetAddressList from, InternetAddressList to, InternetAddressList cc, InternetAddressList bcc, InternetAddressList replyTo, string? messageId, DateTimeOffset? date, string? inReplyTo, string? references, string? textBody, string? htmlBody, IReadOnlyList<MimeAttachment> attachments)
Parameters
Type Name Description
MimeHeaderCollection headers
MimeEntity body
string subject
InternetAddressList from
InternetAddressList to
InternetAddressList cc
InternetAddressList bcc
InternetAddressList replyTo
string messageId
DateTimeOffset? date
string inReplyTo
string references
string textBody
string htmlBody
IReadOnlyList<MimeAttachment> attachments

Properties

View Source

Attachments

Gets the attachments of this message.

Declaration
public IReadOnlyList<MimeAttachment> Attachments { get; }
Property Value
Type Description
IReadOnlyList<MimeAttachment>
View Source

Bcc

Gets the Bcc address list.

Declaration
public InternetAddressList Bcc { get; }
Property Value
Type Description
InternetAddressList
View Source

Body

Gets the body entity of this message.

Declaration
public MimeEntity Body { get; }
Property Value
Type Description
MimeEntity
View Source

Cc

Gets the Cc address list.

Declaration
public InternetAddressList Cc { get; }
Property Value
Type Description
InternetAddressList
View Source

Date

Gets the Date header value, or null if not present.

Declaration
public DateTimeOffset? Date { get; }
Property Value
Type Description
DateTimeOffset?
View Source

From

Gets the From address list.

Declaration
public InternetAddressList From { get; }
Property Value
Type Description
InternetAddressList
View Source

Headers

Gets all headers of this message.

Declaration
public MimeHeaderCollection Headers { get; }
Property Value
Type Description
MimeHeaderCollection
View Source

HtmlBody

Gets the decoded HTML body (first text/html part), or null if not present.

Declaration
public string? HtmlBody { get; }
Property Value
Type Description
string
View Source

InReplyTo

Gets the In-Reply-To header value, or null if not present.

Declaration
public string? InReplyTo { get; }
Property Value
Type Description
string
View Source

MessageId

Gets the Message-ID header value, or null if not present.

Declaration
public string? MessageId { get; }
Property Value
Type Description
string
View Source

References

Gets the References header value, or null if not present.

Declaration
public string? References { get; }
Property Value
Type Description
string
View Source

ReplyTo

Gets the Reply-To address list.

Declaration
public InternetAddressList ReplyTo { get; }
Property Value
Type Description
InternetAddressList
View Source

Subject

Gets the Subject header value, or null if not present.

Declaration
public string? Subject { get; }
Property Value
Type Description
string
View Source

TextBody

Gets the decoded text body (first text/plain part), or null if not present.

Declaration
public string? TextBody { get; }
Property Value
Type Description
string
View Source

To

Gets the To address list.

Declaration
public InternetAddressList To { get; }
Property Value
Type Description
InternetAddressList

Methods

View Source

Load(Stream)

Loads a MimeMessage from the specified stream.

Declaration
public static MimeMessage Load(Stream stream)
Parameters
Type Name Description
Stream stream

The stream used to read or write the data.

Returns
Type Description
MimeMessage
View Source

Load(string)

Loads a MimeMessage from the specified file.

Declaration
public static MimeMessage Load(string fileName)
Parameters
Type Name Description
string fileName

The file or path to process.

Returns
Type Description
MimeMessage
View Source

Write(Stream)

Writes this message to the specified stream.

Declaration
public void Write(Stream stream)
Parameters
Type Name Description
Stream stream

The stream used to read or write the data.

View Source

Write(string)

Writes this message to the specified file.

Declaration
public void Write(string fileName)
Parameters
Type Name Description
string fileName

The file or path to process.

  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX