/// <summary> /// Is called when message sending has completed. /// </summary> /// <param name="op">Asynchronous operation.</param> /// <exception cref="ArgumentNullException">Is raised when <b>op</b> is null reference.</exception> private void MessageSendingCompleted(SMTP_Client.SendMessageAsyncOP op) { if(op == null){ throw new ArgumentNullException("op"); } try{ if(op.Error != null){ Dispose(op.Error); } // Message sent sucessfully. else{ Dispose(null); } } catch(Exception x){ Dispose(x); } op.Dispose(); }