internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients,
string deliveryNotify, bool allowUnicode, AsyncCallback callback, object state)
{
if (sender == null)
{
throw new ArgumentNullException(nameof(sender));
}
if (recipients == null)
{
throw new ArgumentNullException(nameof(recipients));
}
if (GlobalLog.IsEnabled && recipients.Count > 0)
{
GlobalLog.Assert("SmtpTransport::BeginSendMail()|recepients.Count <= 0");
}
SendMailAsyncResult result = new SendMailAsyncResult(_connection, sender, recipients,
allowUnicode, _connection.DSNEnabled ? deliveryNotify : null,
callback, state);
result.Send();
return(result);
}