System.Net.Mail.SendMailAsyncResult.End C# (CSharp) Method

End() static private method

static private End ( IAsyncResult result ) : System.Net.Mail.MailWriter
result IAsyncResult
return System.Net.Mail.MailWriter
        internal static MailWriter End(IAsyncResult result)
        {
            SendMailAsyncResult thisPtr = (SendMailAsyncResult)result;
            object sendMailResult = thisPtr.InternalWaitForCompletion();

            // Note the difference between the singular and plural FailedRecipient exceptions.
            // Only fail immediately if we couldn't send to any recipients.
            if ((sendMailResult is Exception)
                && (!(sendMailResult is SmtpFailedRecipientException)
                    || ((SmtpFailedRecipientException)sendMailResult).fatal))
            {
                throw (Exception)sendMailResult;
            }

            return new MailWriter(thisPtr._stream);
        }
        private void SendMailFrom()

Usage Example

 internal MailWriter EndSendMail(IAsyncResult result)
 {
     try {
         return(SendMailAsyncResult.End(result));
     }
     finally {
     }
 }