enough_mail library

With enough_mail you can connect to any mail service via IMAP, POP3 and SMTP

You can choose between a high-level API starting with MailClient and the low-level APIs ImapClient, PopClient and SmtpClient.

Generate a new MimeMessage with MessageBuilder.

Discover connection settings with Discover.

Classes

AttachmentInfo
Information about a file that is attached
Base64MailCodec
Provides base64 encoder and decoder.
BinaryMimeData
Represents binary mime data
BodyPart
A BODY or BODYSTRUCTURE information element
Capability
Describes a capability
ClientConfig
Provides discovery information
ConfigEmailProvider
Contains configuration settings for a single email service
ContentDispositionHeader
Specifies the content disposition header of a mime part. Compare https://tools.ietf.org/html/rfc2183 for details.
ContentInfo
Provides high level information about content parts.
ContentTypeHeader
Eases reading content-type header values
DateCodec
Encodes and decodes dates according to MIME requirements.
DeleteResult
Provides information about a delete action
Discover
Helps discovering email connection settings based on an email address.
Envelope
Contains the envelope information about a message.
FetchImapResult
Result for FETCH operations
GenericImapResult
A generic result that provide details about the success or failure of the command.
Encapsulates a MIME header
Id
Contains classes to support RFC 2971
ImapClient
Low-level IMAP library.
ImapConnectionLostEvent
Notifies about a connection lost
ImapEvent
Base class for any event that can be fired by the IMAP client at any time. Compare ImapClient.eventBus
ImapExpungeEvent
Notifies about a message that has been deleted
ImapFetchEvent
Notifies about a message that has changed its status / flags
ImapMessagesExistEvent
Notifies about new messages
ImapMessagesRecentEvent
Notifies about new messages
ImapServerInfo
Keeps information about the remote IMAP server
ImapVanishedEvent
Notifies about a sequence of messages that have been deleted. This event can only be triggered if the server is QRESYNC compliant and after the client has enabled QRESYNC.
ImapWarning
Warnings can often be ignored but provide more insights in case of problems They are given in untagged responses of the server.
MailAccount
Contains information about a single mail account
MailAddress
An email address can consist of separate fields
MailAuthentication
Contains an authentication for a mail service Compare PlainAuthentication and OauthAuthentication for implementations.
Mailbox
Stores meta data about a folder aka Mailbox
MailClient
Highlevel online API to access mail.
MailCodec
Encodes and decodes base-64 and quoted printable encoded texts
MailConnectionLostEvent
Notifies about a lost connection
MailConnectionReEstablishedEvent
Notifies about a connection that has been re-established
MailConventions
Contains various mail specific conventions
MailEvent
Base class for any event that can be fired by the MailClient at any time. Compare MailClient.eventBus
MailLoadEvent
Notifies about a message that has been deleted
MailSearch
Abstracts a typical mail search
MailSearchResult
Contains the result of a search
MailServerConfig
Configuration of a specific mail service like IMAP, POP3 or SMTP
MailUpdateEvent
Notifies about an mail flags update
MailVanishedEvent
Notifies about the removal of messages
MediaType
Describes the media type of a MIME message part
MessageBuilder
Simplifies creating mime messages for sending or storing.
MessageFlags
Contains common message flags
MessageListing
Basic information about a message
MessageSequence
Defines a list of message IDs.
MessagesOperationResult
Base class for operation results based on messages
MetaDataEntries
Contains meta data entries
MetaDataEntry
A meta data element
MimeData
Abstracts textual or binary mime data
MimeMessage
A MIME message
MimePart
A MIME part In a simple case a MIME message only has one MIME part.
MimeThread
Abstract a mime message thread
MoveResult
Result for move operations
OauthAuthentication
Provides an OAuth-compliant authentication
OauthToken
Contains an OAuth compliant token
PagedMessageResult
Base class for actions that result in a partial fetching of messages
PagedMessageSequence
A paginated list of message IDs
ParameterizedHeader
A parameter that may contain additional parameters
PartBuilder
Allows to configure a mime part
PlainAuthentication
Provides a simple username-password authentication
PopClient
Client to access POP3 compliant servers. Compare https://tools.ietf.org/html/rfc1939 for details.
PopConnectionLostEvent
Informs about a lost connection
PopEvent
Base event class
PopResponse<T>
Provides access to a POP response coming from the POP service
PopServerInfo
The server information
PopStatus
Provides status information about a POP service
QResyncParameters
Classes for implementing QRESYNC https://tools.ietf.org/html/rfc7162 QRESYNC parameters when doing a SELECT or EXAMINE.
QuotaResult
Result for QUOTA operations
QuotaRootResult
Result for QUOTAROOT operations
QuotedPrintableMailCodec
Provides quoted printable encoder and decoder.
ResourceLimit
QUOTA resource limit
Response<T>
Base class for command responses.
ReturnOption
Return option definition for extended commands.
SearchImapResult
Result for SEARCH and UID SEARCH operations
SearchQueryBuilder
Creates a new search query.
SearchTerm
Base class for all search terms
SearchTermAll
Searches all messages
SearchTermAnswered
Searches for answered/replied messages
SearchTermBcc
Searches for messages with a BCC recipient that matches
SearchTermBefore
Searches for messages stored before the given date.
SearchTermBody
Searches in the body of messages. This is usually a long lasting operation.
SearchTermCc
Searches for messages with a matching recipient on CC
SearchTermCharsetUf8
Set the charset to UTF8
SearchTermDeleted
Searches for deleted messages
SearchTermDraft
Searches for draft messages
SearchTermFlagged
Searches for flagged messages
SearchTermFrom
Searches for messages where the sender matches the senderPart
SearchTermHeader
Searches for messages with the given header
SearchTermKeyword
Searches for messages flagged with the given keyword
SearchTermLarger
Searches for messages that are bigger than the given size
SearchTermNew
Searches for new messages
SearchTermNot
Negates the given search term
SearchTermOld
Searches for old messages
SearchTermOn
Searches for message stored at the given day
SearchTermOr
Combines two atomic search terms in an OR way Note that you cannot nest an OR term into another OR term
SearchTermRecent
Searches for recent messages
SearchTermSeen
Searches for seen / read messages
SearchTermSentBefore
Searches for messages sent before the given date
SearchTermSentOn
Searches for message sent at the given day
SearchTermSentSince
Searches message sent after the given time
SearchTermSince
Searches for messages stored after the given time
SearchTermSmaller
Searches messages with a size less than given
SearchTermSubject
Searches for messages with a matching subject
SearchTermText
Searches any text header
SearchTermTo
Searches for recipients
SearchTermUnanswered
Searches messages without the replied flag
SearchTermUndeleted
Searches messages that are not deleted
SearchTermUndraft
Searches for messages that carry no draft flag
SearchTermUnflagged
Search for not flagged messages
SearchTermUnkeyword
Searches for messages without the keyword
SearchTermUnseen
Searches for unseen messages
SequenceNode
A message sequence to handle nested IDs like in the IMAP THREAD extension.
ServerConfig
The configuration for a single server
SmtpClient
Low-level SMTP library for Dart
SmtpConnectionLostEvent
Event signalling a lost connection
SmtpEvent
Base SMTP event
SmtpResponse
Contains a response from the SMTP server
SmtpResponseLine
Contains a single SMTP response line
SmtpServerInfo
Keeps information about the remote SMTP server
SortImapResult
Result for SORT and UID SORT operations
StoreImapResult
Result for STORE and UID STORE operations
TextMimeData
Represents textual mime data
ThreadDataResult
Contains information about threads
ThreadResult
Encapsulates a thread result
Tree<T>
Contains a tree like structure
TreeElement<T>
An Element in a Tree
UidResponseCode
Contains a UID response code
UidSearchTerm
Searches for the given UID messages
UserNameBasedAuthentication
Base class for authentications with user-names

Enums

Authentication
The type of authentication
AuthMechanism
Defines the available authentication mechanism
CharacterSet
The used character set
ContentDisposition
Specifies the content disposition of a mime part. Compare https://tools.ietf.org/html/rfc2183 for details.
DeleteAction
The internal action that was used for deletion. This is useful for undoing and delete operation.
FetchPreference
The client's preference when fetching messages
HeaderEncoding
The used header encoding mechanism
ImapEventType
Classification of IMAP events
MailboxFlag
Contains common flags for mailboxes
MailEventType
Classification of Mail events
MediaSubtype
Detailed media types Compare https://www.iana.org/assignments/media-types/media-types.xhtml
MediaToptype
Top level media types
MetaDataDepth
The depth of a meta data request
MoveAction
Possible move implementations
PopEventType
Common POP event types
RecipientGroup
The recipient
ResponseStatus
Status for command responses.
SearchMessageType
Defines what kind of messages should be searched
SearchQueryType
Which part of the message should be searched
SelectionOptions
LIST-EXTENDED selection options
SequenceNodeSelectionMode
Selection mode for retrieving a MessageSequence from a nested SequenceNode structure.
ServerType
The type of the server
SmtpEventType
Types of SMTP events
SmtpResponseType
Basic type of a SMTP response
SocketType
The socket type
StatusFlags
Options for querying status updates
StoreAction
Possible flag store actions
ThreadPreference
Defines the thread fetching preference
TransferEncoding
The transfer-encoding used for encoding 8bit data if necessary
UsernameType
The user name configuration

Extensions

MediaSubtypeExtension on MediaSubtype
Extension on MediaSubtype
SequenceExtension on List<MimeMessage>
Allows to get a sequence for a list of MimeMessages easily
Stringify on SelectionOptions
Extension on SelectionOptions

Typedefs

MailEventFilter = bool Function(MailEvent event)
Definition for optional event filters, compare MailClient.addEventFilter.

Exceptions / Errors

BaseMailException
Base exception for any IMAP, POP, SMTP or highlevel API exceptions
ImapException
Provides information about an exception
InvalidArgumentException
Notifies about an invalid argument
MailException
Provides details about high level unexpected events
PopException
Informs about an exceptional case when dealing with a POP service
SmtpException
Contains details about SMTP problems