send function
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);
final connection = await client.connect(smtpServer, timeout);
try {
final sendReport = await _send(message, connection, timeout);
return sendReport;
} finally {
await client.close(connection);
}
}