Exemplo n.º 1
0
        public Form_WriteMail(IMailReceiver receiver)
        {
            InitializeComponent();


            m_receiver = receiver;
        }
Exemplo n.º 2
0
        public void Logon(InternetMailProfile profile, InternetMailProtocol receiveMailProtocol = InternetMailProtocol.Pop3)
        {
            _profile = profile;

            if (!string.IsNullOrEmpty(_profile.SmtpServerAddress) && !_profile.Pop3BeforeSmtp)
            {
                LogonSmtp();
            }

            switch (receiveMailProtocol)
            {
            case InternetMailProtocol.Imap:

                receiver = new ImapReceiver();
                if (!string.IsNullOrEmpty(_profile.ImapServerAddress))
                {
                    receiver.Logon(_profile);
                }

                break;

            case InternetMailProtocol.Pop3:

                receiver = new Pop3Receiver();
                if (!string.IsNullOrEmpty(_profile.Pop3ServerAddress))
                {
                    receiver.Logon(_profile);
                }

                break;

            case InternetMailProtocol.Smtp:

                throw new RuntimeException("Недопустимо указывать SMTP в качестве протокола получения почты!");
            }

            if (!string.IsNullOrEmpty(_profile.SmtpServerAddress) && _profile.Pop3BeforeSmtp)
            {
                LogonSmtp();
            }
        }
Exemplo n.º 3
0
 public UserTestService(NaheulbookHttpClient naheulbookHttpClient, IMailReceiver mailReceiver, DbContextOptions <NaheulbookDbContext> dbContextOptions)
 {
     _naheulbookHttpClient = naheulbookHttpClient;
     _mailReceiver         = mailReceiver;
     _dbContextOptions     = dbContextOptions;
 }
Exemplo n.º 4
0
 public MailSteps(ScenarioContext scenarioContext, IMailReceiver mailReceiver)
 {
     _scenarioContext = scenarioContext;
     _mailReceiver    = mailReceiver;
 }