SmtpClient class Null safety

Low-level SMTP library for Dartlang

Compliant to Extended SMTP standard.

Constructors

SmtpClient(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
read / write, inherited
connectionTimeout Duration?
final, inherited
eventBus EventBus
Allows to listens for events [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isLogEnabled bool
read / write, inherited
isLoggedIn bool
read / write, inherited
isSocketClosingExpected bool
read / write, inherited
logName String?
read / write, inherited
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.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
serverInfo SmtpServerInfo
Information about the SMTP service
read / write

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.
@Deprecated('Please use `disconnect()` instead.')
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.
@Deprecated('Please use authenticate() instead.')
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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