/// <summary> /// Is called when MAIL command has completed. /// </summary> /// <param name="op">Asynchronous operation.</param> /// <exception cref="ArgumentNullException">Is raised when <b>op</b> is null reference.</exception> private void MailCommandCompleted(SMTP_Client.MailFromAsyncOP op) { if (op == null) { throw new ArgumentNullException("op"); } try{ if (op.Error != null) { Dispose(op.Error); } else { SMTP_Client.RcptToAsyncOP rcptOP = new SMTP_Client.RcptToAsyncOP( this.To, IsDsnSupported() ? m_pRelayItem.DSN_Notify : SMTP_DSN_Notify.NotSpecified, IsDsnSupported() ? m_pRelayItem.OriginalRecipient : null ); rcptOP.CompletedAsync += delegate(object s, EventArgs <SMTP_Client.RcptToAsyncOP> e){ RcptCommandCompleted(rcptOP); }; if (!m_pSmtpClient.RcptToAsync(rcptOP)) { RcptCommandCompleted(rcptOP); } } } catch (Exception x) { Dispose(x); } }