Exemplo n.º 1
0
        private SendStatus Send(bool showDlg)
        {
            if (IsSending)
            {
                throw new InvalidOperationException("ShowMailClient or Send has already been called.");
            }

            IsSending = true;
            try
            {
                return(MAPI32.SendMail(this, showDlg));
            }
            finally
            {
                IsSending = false;
            }
        }
Exemplo n.º 2
0
        private void SendAsyncWorker(object args)
        {
            var sendArgs = args as SendAsyncThreadArgs;
            SendAsyncCompletedEventArgs e;

            try
            {
                var status = MAPI32.SendMail(this, sendArgs.ShowDialog);
                e = new SendAsyncCompletedEventArgs(status);
            }
            catch (Exception ex)
            {
                e = new SendAsyncCompletedEventArgs(ex);
            }
            finally
            {
                IsSending = false;
            }

            sendArgs.Operation.PostOperationCompleted(mSendAsyncCompleteCallback, e);
        }