SmtpClient class

Low-level SMTP library for Dartlang

Compliant to Extended SMTP standard.

Constructors

SmtpClient.new(String clientDomain, {EventBus? bus, bool isLogEnabled = false, String? logName, Duration? connectionTimeout, bool onBadCertificate(X509Certificate)?})
Creates a new instance with the specified clientDomain that is associated with your service's domain, e.g. domain.com or enough.de.

Properties

connectionInfo ↔ ConnectionInfo
getter/setter pairinherited
connectionTimeout Duration?
finalinherited
eventBus → EventBus
Allows to listens for events
no setter
hashCode int
The hash code for this object.
no setterinherited
isLogEnabled bool
getter/setter pairinherited
isLoggedIn bool
getter/setter pairinherited
isSocketClosingExpected bool
getter/setter pairinherited
logName String?
getter/setter pairinherited
onBadCertificate bool Function(X509Certificate)?
onBadCertificate is an optional handler for unverifiable certificates. The handler receives the X509Certificate, and can inspect it and decide (or let the user decide) whether to accept the connection or not. The handler should return true to continue the SecureSocket connection.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverInfo SmtpServerInfo
Information about the SMTP service
getter/setter pair

Methods

authenticate(String name, String password, [AuthMechanism authMechanism = AuthMechanism.plain]) Future<SmtpResponse>
Signs in the user with the given name and password.
closeConnection() Future
Closes the connection to the remote SMTP server.
connect(Socket socket, {ConnectionInfo? connectionInformation}) → void
Starts to liste on socket.
inherited
connectToServer(String host, int port, {bool isSecure = true}) Future<ConnectionInfo>
Connects to the specified server.
inherited
disconnect() Future<void>
inherited
ehlo() Future<SmtpResponse>
Issues the enhanced helo command to find out the capabilities of the SMTP server
log(dynamic logObject, {bool isClient = true, String? initial}) → void
inherited
login(String name, String password, {AuthMechanism authMechanism = AuthMechanism.plain}) Future<SmtpResponse>
Signs in the user with the given name and password.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onConnectionDone() → void
inherited
onConnectionError(dynamic error) → void
onConnectionEstablished(ConnectionInfo connectionInfo, String serverGreeting) → void
onDataReceived(Uint8List data) → void
onServerResponse(List<String> responseTexts) → void
quit() Future<SmtpResponse>
sendChunkedMessage(MimeMessage message, {bool use8BitEncoding = false, MailAddress? from, List<MailAddress>? recipients}) Future<SmtpResponse>
Sends the specified message using the BDAT SMTP command.
sendChunkedMessageData(MimeData data, MailAddress from, List<MailAddress> recipients, {bool use8BitEncoding = false}) Future<SmtpResponse>
Sends the specified message data from to the recipients using the BDAT SMTP command.
sendChunkedMessageText(String text, MailAddress from, List<MailAddress> recipients, {bool use8BitEncoding = false}) Future<SmtpResponse>
Sends the specified message text from to the recipients using the BDAT SMTP command.
sendCommand(SmtpCommand command) Future<SmtpResponse>
sendMessage(MimeMessage message, {bool use8BitEncoding = false, MailAddress? from, List<MailAddress>? recipients}) Future<SmtpResponse>
Sends the specified message.
sendMessageData(MimeData data, MailAddress from, List<MailAddress> recipients, {bool use8BitEncoding = false}) Future<SmtpResponse>
Sends the specified message data from to the recipients.
sendMessageText(String text, MailAddress from, List<MailAddress> recipients, {bool use8BitEncoding = false}) Future<SmtpResponse>
Sends the specified message text from to the recipients.
startTls() Future<SmtpResponse>
Upgrades the current insure connection to SSL.
toString() String
A string representation of this object.
inherited
upradeToSslSocket() Future<void>
inherited
writeData(List<int> data, [dynamic logObject]) Future
Writes the specified data.
inherited
writeText(String text, [dynamic logObject]) Future
Writes the specified text.
inherited

Operators

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