Send() private method

private Send ( ) : void
return void
Exemplo n.º 1
0
        internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients,
                                            string deliveryNotify, bool allowUnicode, AsyncCallback callback, object state)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            if (recipients == null)
            {
                throw new ArgumentNullException(nameof(recipients));
            }

            if (GlobalLog.IsEnabled && recipients.Count > 0)
            {
                GlobalLog.Assert("SmtpTransport::BeginSendMail()|recepients.Count <= 0");
            }

            SendMailAsyncResult result = new SendMailAsyncResult(_connection, sender, recipients,
                                                                 allowUnicode, _connection.DSNEnabled ? deliveryNotify : null,
                                                                 callback, state);

            result.Send();
            return(result);
        }
 internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients, string deliveryNotify, AsyncCallback callback, object state)
 {
     if (sender == null)
     {
         throw new ArgumentNullException("sender");
     }
     if (recipients == null)
     {
         throw new ArgumentNullException("recipients");
     }
     SendMailAsyncResult result = new SendMailAsyncResult(this.connection, sender.SmtpAddress, recipients, this.connection.DSNEnabled ? deliveryNotify : null, callback, state);
     result.Send();
     return result;
 }
Exemplo n.º 3
0
        internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients, string deliveryNotify, AsyncCallback callback, object state)
        {
            if (sender == null)
            {
                throw new ArgumentNullException("sender");
            }
            if (recipients == null)
            {
                throw new ArgumentNullException("recipients");
            }
            SendMailAsyncResult result = new SendMailAsyncResult(this.connection, sender.SmtpAddress, recipients, this.connection.DSNEnabled ? deliveryNotify : null, callback, state);

            result.Send();
            return(result);
        }
Exemplo n.º 4
0
        internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients,
                                            string deliveryNotify, bool allowUnicode, AsyncCallback callback, object state)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            if (recipients == null)
            {
                throw new ArgumentNullException(nameof(recipients));
            }

            SendMailAsyncResult result = new SendMailAsyncResult(_connection, sender, recipients,
                                                                 allowUnicode, _connection.DSNEnabled ? deliveryNotify : null,
                                                                 callback, state);

            result.Send();
            return(result);
        }
Exemplo n.º 5
0
        internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients, 
            string deliveryNotify, bool allowUnicode, AsyncCallback callback, object state)
        {
            if (sender == null)
            {
                throw new ArgumentNullException("sender");
            }

            if (recipients == null)
            {
                throw new ArgumentNullException("recipients");
            }

            GlobalLog.Assert(recipients.Count > 0, "SmtpTransport::BeginSendMail()|recepients.Count <= 0");
            
            SendMailAsyncResult result = new SendMailAsyncResult(connection, sender, recipients,
                allowUnicode, connection.DSNEnabled ? deliveryNotify : null, 
                callback, state);
            result.Send();
            return result;
        }
Exemplo n.º 6
0
        internal IAsyncResult BeginSendMail(MailAddress sender, MailAddressCollection recipients,
            string deliveryNotify, bool allowUnicode, AsyncCallback callback, object state)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }

            if (recipients == null)
            {
                throw new ArgumentNullException(nameof(recipients));
            }

            SendMailAsyncResult result = new SendMailAsyncResult(_connection, sender, recipients,
                allowUnicode, _connection.DSNEnabled ? deliveryNotify : null,
                callback, state);
            result.Send();
            return result;
        }