public SmtpResponderFactory(IConfiguredSmtpRestrictions configuration,
            IEmailValidator emailValidator = null,
            IGetSmtpCapabilities getSmtpCapabilities = null)
        {
            if (configuration == null) throw new ArgumentNullException("configuration");
            
            emailValidator = emailValidator ?? new XamarinEmailValidator();
            getSmtpCapabilities = getSmtpCapabilities ?? new GetDefaultSmtpCapabilities(configuration);

            DataResponder = new SmtpDataResponder(configuration);
            IdentificationResponder = new SmtpIdentificationResponder(configuration, getSmtpCapabilities);
            MailFromResponder = new SmtpMailFromResponder(configuration, emailValidator);
            RecipientToResponder = new SmtpRecipientToResponder(configuration, emailValidator);
            RawLineResponder = new SmtpRawLineResponder(configuration);
            ResetResponder = new SmtpResetResponder(configuration);
            VerifyResponder = new SmtpVerifyResponder(configuration);
        }
Exemplo n.º 2
0
        public SmtpResponderFactory(IConfiguredSmtpRestrictions configuration,
                                    IEmailValidator emailValidator           = null,
                                    IGetSmtpCapabilities getSmtpCapabilities = null)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            emailValidator      = emailValidator ?? new XamarinEmailValidator();
            getSmtpCapabilities = getSmtpCapabilities ?? new GetDefaultSmtpCapabilities(configuration);

            DataResponder           = new SmtpDataResponder(configuration);
            IdentificationResponder = new SmtpIdentificationResponder(configuration, getSmtpCapabilities);
            MailFromResponder       = new SmtpMailFromResponder(configuration, emailValidator);
            RecipientToResponder    = new SmtpRecipientToResponder(configuration, emailValidator);
            RawLineResponder        = new SmtpRawLineResponder(configuration);
            ResetResponder          = new SmtpResetResponder(configuration);
            VerifyResponder         = new SmtpVerifyResponder(configuration);
        }