MimeMessage class

A MIME message

Inheritance

Constructors

MimeMessage()
Creates a new empty mime message
MimeMessage.fromEnvelope(Envelope value, {int? uid, int? guid, int? sequenceId, List<String>? flags})
Creates a new message from the given envelope.
MimeMessage.parseFromData(Uint8List data)
Creates a new message based on the specified binary data.
MimeMessage.parseFromText(String text)
Deserializes a new message based on the specified rendered text form.

Properties

allPartsFlat List<MimePart>
Puts all parts of this message into a flat sequential list.
no setter
bcc List<MailAddress>?
The recipients not visible to other recipients
getter/setter pair
body BodyPart?
The body structure of the message.
getter/setter pair
cc List<MailAddress>?
The recipients on carbon-copy (CC)
getter/setter pair
envelope Envelope?
The envelope of the message.
getter/setter pair
flags List<String>?
Message flags like \Seen, \Recent, etc
getter/setter pair
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
getter/setter pair
fromEmail String?
The email of the first from address of this message
no setter
guid int?
The guid of the message.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
headers List<Header>?
The headers field contains all message(part) headers
getter/setter pairinherited
internalDate String?
The internal date of the message on the recipient's provider server
getter/setter pair
isAnswered bool
Checks if this message has been replied
getter/setter pair
isDeleted bool
Checks if this message has been marked as deleted
getter/setter pair
isDownloaded bool
Checks if this message contents has been downloaded
no setter
isFlagged bool
Checks if this message has been marked as important / flagged
getter/setter pair
isForwarded bool
Checks if this message has been forwarded
getter/setter pair
isMdnSent bool
Checks if a read receipt has been sent for this message
getter/setter pair
isReadReceiptRequested bool
Checks if a disposition notification message is requested.
no setter
isReadReceiptSent bool
Checks if a read receipt has been sent for this message
getter/setter pair
isSeen bool
Checks if this message has been read
getter/setter pair
mediaType MediaType
Simplified way to retrieve the media type When no content-type header is defined, the media type text/plain is returned
no setterinherited
mimeData MimeData?
The raw message data of this part.
getter/setter pairinherited
modSequence int?
The modifications sequence of this message.
getter/setter pair
parts List<MimePart>?
The children of this part, if any.
getter/setter pairinherited
recipientAddresses List<String>
Retrieves the mail addresses of all message recipients
no setter
recipients List<MailAddress>
Retrieves the mail addresses of all message recipients
no setter
replyTo List<MailAddress>?
The address that should be used for replies
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sender MailAddress?
The sender of the message
getter/setter pair
sequenceId int?
The index of the message, if known
getter/setter pair
size int?
The size of the message in bytes
getter/setter pair
threadSequence MessageSequence?
The thread sequence, this can be populated manually
getter/setter pair
to List<MailAddress>?
The recipients of the message
getter/setter pair
uid int?
The uid of the message, if known
getter/setter pair

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
Adds the part at the end of all parts.
inherited
collectContentInfo(ContentDisposition disposition, List<ContentInfo> result, String? fetchId, {bool? reverse, bool? complete}) → void
Adds the matching disposition header with the specified disposition
inherited
copyIndividualParts(MimeMessage other) → void
Copies all individually loaded parts from other to this message.
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
decodeSubject() String?
Decodes the subject of this message
decodeTextHtmlPart() String?
Tries to find a 'content-type: text/html' part
override
decodeTextPlainPart() String?
Tries to find a 'content-type: text/plain' part
override
findContentInfo({ContentDisposition disposition = ContentDisposition.attachment, bool? withCleanParts, bool? complete}) List<ContentInfo>
Retrieves all content info of parts with the specified disposition Content-Type header.
findRecipient(MailAddress recipient, {List<MailAddress>? aliases, bool allowPlusAliases = false}) MailAddress?
Finds the matching recipient address.
findSender(MailAddress sender, {List<MailAddress>? aliases, bool allowPlusAliases = false}) MailAddress?
Finds the matching sender address.
getAlternativePart(MediaSubtype subtype) MimePart?
Searches for this the given subtype as a part of a Multipart/Alternative mime part.
override
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.
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
Inserts the part at the beginning of all parts.
inherited
isFrom(MailAddress sender, {List<MailAddress>? aliases, bool allowPlusAliases = false}) bool
Checks of this messaging is from the specified sender address.
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 nonexistent 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
Serializes 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 enable.
setGuid({required String email, required String encodedMailboxName, required int mailboxUidValidity}) → void
Calculates and sets the guid of this message.
setHeader(String name, String? value, [HeaderEncoding encoding = HeaderEncoding.none]) → void
Sets a header with the specified name, value and optional encoding,
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.
override

Static Methods

calculateGuid({required String email, required String encodedMailboxName, required int mailboxUidValidity, required int messageUid}) int
Generates a global unique ID to identify a message reliably and robustly.