コード例 #1
0
        private void SendMailFrom()
        {
            IAsyncResult result = MailCommand.BeginSend(this.connection, SmtpCommands.Mail, this.from, sendMailFromCompleted, this);

            if (result.CompletedSynchronously)
            {
                MailCommand.EndSend(result);
                this.SendTo();
            }
        }
コード例 #2
0
ファイル: SmtpTransport.cs プロジェクト: rsumner31/corefx2
        private void SendMailFrom()
        {
            IAsyncResult result = MailCommand.BeginSend(_connection, SmtpCommands.Mail, _from, _allowUnicode,
                                                        s_sendMailFromCompleted, this);

            if (!result.CompletedSynchronously)
            {
                return;
            }

            MailCommand.EndSend(result);
            SendToCollection();
        }
コード例 #3
0
ファイル: SmtpTransport.cs プロジェクト: rsumner31/corefx2
 private static void SendMailFromCompleted(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SendMailAsyncResult thisPtr = (SendMailAsyncResult)result.AsyncState;
         try
         {
             MailCommand.EndSend(result);
             thisPtr.SendToCollection();
         }
         catch (Exception e)
         {
             thisPtr.InvokeCallback(e);
         }
     }
 }
コード例 #4
0
 private static void SendMailFromCompleted(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SendMailAsyncResult asyncState = (SendMailAsyncResult)result.AsyncState;
         try
         {
             MailCommand.EndSend(result);
             asyncState.SendTo();
         }
         catch (Exception exception)
         {
             asyncState.InvokeCallback(exception);
         }
     }
 }