send function

Future<SendReport> send(
  1. Message message,
  2. SmtpServer smtpServer, {
  3. Duration? timeout,
})

Throws following exceptions: SmtpClientAuthenticationException, SmtpClientCommunicationException, SocketException SmtpMessageValidationException Please report other exceptions you encounter.

Implementation

Future<SendReport> send(Message message, SmtpServer smtpServer,
    {Duration? timeout}) async {
  _validate(message);
  var connection = await client.connect(smtpServer, timeout);
  var sendReport = await _send(message, connection, timeout);
  await client.close(connection);
  return sendReport;
}