MimeMessage class Null safety

A MIME message

Inheritance

Constructors

MimeMessage()

Properties

allPartsFlat List<MimePart>
Puts all parts of this message into a flat sequential list.
read-only
bcc List<MailAddress>?
read / write
body BodyPart?
The body structure of the message. [...]
read / write
cc List<MailAddress>?
read / write
envelope Envelope?
The envelope of the message. [...]
read / write
flags List<String>?
Message flags like \Seen, \Recent, etc
read / write
from List<MailAddress>?
according to RFC 2822 section 3.6.2. there can be more than one FROM address, in that case the sender MUST be specified
read / write
fromEmail String?
The email of the first from address of this message
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
headers List<Header>?
The headers field contains all message(part) headers
read / write, inherited
internalDate String?
The internal date of the message on the recipient's provider server
read / write
isAnswered bool
Checks if this message has been replied
read / write
isDeleted bool
Checks if this message has been marked as deleted
read / write
isDownloaded bool
Checks if this message contents has been downloaded
read-only
isFlagged bool
Checks if this message has been marked as important / flagged
read / write
isForwarded bool
Checks if this message has been forwarded
read / write
isMdnSent bool
Checks if a read receipt has been sent for this message
@Deprecated('Use isReadReceiptSent instead'), @Deprecated('Use isReadReceiptSent instead'), read / write
isReadReceiptRequested bool
Checks if a disposition notification message is requested. [...]
read-only
isReadReceiptSent bool
Checks if a read receipt has been sent for this message [...]
read / write
isSeen bool
Checks if this message has been read
read / write
mediaType MediaType
Simplified way to retrieve the media type When no content-type header is defined, the media type text/plain is returned
read-only, inherited
mimeData MimeData?
The raw message data of this part. May or may not include headers, depending on retrieval.
read / write, inherited
modSequence int?
The modifications sequence of this message. This is only returned by servers that support the CONDSTORE capability and can be fetch explicitely with 'MODSEQ'.
read / write
parts List<MimePart>?
The children of this part, if any.
read / write, inherited
recipientAddresses List<String>
Retrieves the mail addresses of all message recipients
read-only
replyTo List<MailAddress>?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sender MailAddress?
read / write
sequenceId int?
The index of the message, if known
read / write
size int?
The size of the message in bytes
read / write
threadSequence MessageSequence?
The thread sequence, this can be populated manually or with MailClient.fetchThreadData.
read / write
to List<MailAddress>?
read / write
uid int?
The uid of the message, if known
read / write

Methods

addFlag(String name) → void
Adds the flag with the specified name to this message. [...]
addHeader(String name, String? value, [HeaderEncoding encoding = HeaderEncoding.none]) → void
Adds a header with the specified name, value and optional encoding.
inherited
addPart(MimePart part) → void
inherited
collectContentInfo(ContentDisposition disposition, List<ContentInfo> result, String? fetchId, {bool? reverse, bool? complete}) → void
Adds the matching disposition header with the specified disposition of this part and this children parts to the result. [...]
inherited
copyIndividualParts(MimeMessage other) → void
decodeContentBinary() Uint8List?
Decodes the binary data of this part.
inherited
decodeContentMessage() MimeMessage?
Decodes a message/rfc822 part
inherited
decodeContentText() String?
Decodes the text of this part.
inherited
decodeDate() DateTime?
Decodes the message 'date' header to local time.
inherited
decodeFileName() String?
Tries to find and decode the associated file name
inherited
decodeHeaderDateValue(String name) DateTime?
Decodes the a date value of the first matching header
inherited
decodeHeaderMailAddressValue(String name) List<MailAddress>?
Decodes the email address value of first matching header
inherited
decodeHeaderValue(String name) String?
Decodes the value of the first matching header
inherited
decodeSender({bool combine = false}) List<MailAddress>
Retrieves the sender of the this message by checking the reply-to, sender and from header values in this order. Set combine to true in case you want to combine the addresses from these headers, by default the first non-emptry entry is returned.
decodeSubject() String?
Decodes the subject of this message
decodeTextHtmlPart() String?
Tries to find a 'content-type: text/html' part and decodes its contents when found.
override
decodeTextPlainPart() String?
Tries to find a 'content-type: text/plain' part and decodes its contents when found.
override
findContentInfo({ContentDisposition disposition = ContentDisposition.attachment, bool? withCleanParts, bool? complete}) List<ContentInfo>
Retrieves all content info of parts with the specified disposition Content-Type. By default the content info with ContentDisposition.attachment are retrieved. Typically this used to list all attachments of a message. Note that either the message contents (BODY[]) or the BODYSTRUCTURE is required to reliably list all matching content elements. All fetchId parsed from the BODYSTRUCTURE are returned in a form compatible with the body parts tree unless withCleanParts is false.
findRecipient(MailAddress recipient, {List<MailAddress>? aliases, bool allowPlusAliases = false}) MailAddress?
Finds the matching recipient address. Optionally specify known aliases and set allowPlusAliases to true to allow aliass such as me+alias@domain.com.
findSender(MailAddress sender, {List<MailAddress>? aliases, bool allowPlusAliases = false}) MailAddress?
Finds the matching sender address. Optionally specify known aliases and set allowPlusAliases to true to allow aliass such as me+alias@domain.com.
getHeader(String name) Iterable<Header>?
Retrieves all matching headers with the specified name.
inherited
getHeaderContentDisposition() ContentDispositionHeader?
Retrieves the first 'content-disposition' header.
inherited
getHeaderContentType() ContentTypeHeader?
Retrieves the first 'content-type' header.
override
getHeaderValue(String name) String?
Retrieves the raw value of the first matching header. [...]
inherited
getPart(String fetchId) MimePart?
Retrieves the part with the specified fetchId. [...]
getPartWithContentId(String cid) MimePart?
Retrieves the part with the specified Content-ID cid.
getPartWithMediaSubtype(MediaSubtype subtype) MimePart?
Searches the MimePart with the specified subtype.
override
hasAttachments() bool
Checks if this message has parts with a Content-Disposition: attachment header.
hasAttachmentsOrInlineNonTextualParts() bool
Checks if this message contains either explicit attachments or non-textual inline parts.
hasContent(ContentDisposition disposition) bool
Checks if this message has parts with the specified disposition. Note that either the full message or the body structure must have been downloaded before.
hasFlag(String name) bool
Checks if the messages has the message flag with the specified name.
hasHeader(String name) bool
Checks if this MIME part has a header with the specified name.
inherited
hasInlineParts() bool
Checks if this message any inline parts.
hasPart(MediaSubtype subtype, {int? depth}) bool
Checks if this MIME part or a child is of the specified media type [...]
inherited
hasTextPart({int? depth}) bool
Checks if this MIME part or a child is textual. [...]
inherited
insertPart(MimePart part) → void
inherited
isFrom(MailAddress sender, {List<MailAddress>? aliases, bool allowPlusAliases = false}) bool
Checks of this messagin is from the specified sender address. Optionally specify known aliases and set allowPlusAliases to true to allow aliass such as me+alias@domain.com. Set allowPlusAliases to true in case + aliases like me+alias@domain.com are valid.
isTextMediaType() bool
Checks if this MIME part is textual.
inherited
isTextMessage() bool
Checks if this is a typical text message Compare isTextPlainMessage Compare decodeTextPlainPart Compare decodeTextHtmlPart
isTextPlainMessage() bool
Checks if this is a typical text message with a plain text part Compare decodeTextPlainPart Compare isTextMessage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
parse() → void
Parses this and all children MIME parts.
inherited
removeFlag(String name) → void
Removes the flag with the specified name from this message. [...]
removeHeader(String name) → void
Removes the header with the specified name.
inherited
render(StringBuffer buffer, {bool renderHeader = true}) → void
Renders this mime part with all children parts into the specified buffer. [...]
inherited
renderMessage({bool renderHeader = true}) String
Renders the complete message into a String. [...]
setFlag(String name, bool enable) → void
Adds or removes the flag with the specified name to/from this message depending on value. [...]
setHeader(String name, String? value, [HeaderEncoding encoding = HeaderEncoding.none]) → void
Sets a header with the specified name, value and optional encoding, replacing any existing header with the same name.
inherited
setPart(String fetchId, MimePart part) → void
Sets the individually loaded part with the given fetchId. [...]
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

parseFromData(Uint8List data) MimeMessage
Creates a new message based on the specified binary data. Compare renderMessage method for converting a message to text.
parseFromText(String text) MimeMessage
Creates a new message based on the specified rendered text form. [...]