close method

Future<void> close()

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

Implementation

Future<void> close() async {
  _logger.finer('Adding "close"-message to mailSendQueue');
  var closeTask = _MailSendTask()..completer = Completer();
  mailSendTasksController.add(closeTask);
  try {
    await closeTask.completer.future;
  } finally {
    await mailSendTasksController.close();
  }
}