Skip to content
Dmitry Boyarintsev edited this page Nov 14, 2021 · 14 revisions

Namespace: AE.Net.Mail

The class name might come in conflict System.Net.Mail.MailMessage

Table of Contents

Public API

UID

The UID, which can be used as the message reference in the client class calls. It's assigned by the protocol.

for Imap UID would be unique for the mailbox. But two different mailboxes can have the same UID. If the message is moved from one mailbox to another UID would be changed.

MessageID

Message ID comes from the mime-header "Message-ID". It should NOT be used for the mail client class calls. It could be however used to recognize the same message, IF different protocols are used to access the same message.

Subject

The subject (title) of the email

Addresses

The following properties of MailAddress are used to identify

  • To - the collection of recipients addresses
  • Sender - the sender of the message
  • From - the displayed from line. (could be different than Sender)
  • ReplyTo - reply to address that should be used when message is "Replied" in the client
  • Cc - the collection of carbon-copy address
  • Bcc - the collection of blind-carbon-copy address
All of them are based on MailAddress class.

It is safe to assume that these properties ALWAYS exist and doesn't need to be checked for null value. However, it's also possible that any collection might not contain ANY values.

Body

The property is not populated, if the message was received with headersonly flag set to true.

The textual representation of the body.

The body DOES NOT contain the entire raw message. Instead the raw body is being parsed into separate either Attachments or AlternativeView collections. The body would either include the "body" section or the first entry in "multipart/alternative" section of the email.

For the human readable representation, it's better to use the convenience methods of AlternateViews property.

AlternateViews

The property is not populated, if the message was received with headersonly flag set to true.

The collection of attachments that were marked as "AlternativeView". Such attachments contain the same message as the body of the email, but are used for a different representation. The typical use is to provide email in TEXT and HTML formats. AlternateViewCollection class, provides two convenience methods GetHtmlView() and GetTextView(). Both return an alternative-view attachement with mime type "text/html" and "text/plain" respectively.

Attachments

The property is not populated, if the message was received with headersonly flag set to true.

The collection of attachments that were not marked as an "AlternativeView", and are treated as (a file) attachments email

Clone this wiki locally