send method

Future<SendReport> send(
  1. Message message
)

Throws following exceptions: SmtpClientAuthenticationException, SmtpUnsecureException, SmtpClientCommunicationException, SocketException // Connection dropped Please report other exceptions you encounter.

Implementation

Future<SendReport> send(Message message) {
  _logger.finer('Adding message to mailSendQueue');
  var mailTask = _MailSendTask()
    ..message = message
    ..completer = Completer();
  mailSendTasksController.add(mailTask);
  return mailTask.completer.future
      // `null` is only a valid return value for connection close messages.
      .then((value) => ArgumentError.checkNotNull(value));
}