Esempio n. 1
0
        private void StartJob()
        {
            foreach (var mailToSend in _elencoMailInInvio.Where(x => !x.State.HasValue))
            {
                mailToSend.State = EMailState.DaInviare;
            }
            Update();
            tbLog.AppendText("Start job invio..." + Environment.NewLine);

            AppRepo.UpdateMailsToSendOfJob(CurrentJobId, _elencoMailInInvio);
            var cfg = AppRepo.LoadSmtpConfig();

            _scheduler.StartJob(CurrentJobId, cfg);
        }
Esempio n. 2
0
        protected override void AfterInitialized()
        {
            base.AfterInitialized();

            _smtpCfg = AppRepo.LoadSmtpConfig();
            if (_smtpCfg == null)
            {
                _smtpCfg = new SmtpConfig()
                {
                    Port = 25
                };
            }

            tbSender.Text           = _smtpCfg.SenderAddress;
            tbSmtpHost.Text         = _smtpCfg.SmtpHost;
            nbPort.Value            = _smtpCfg.Port;
            tbUsername.Text         = _smtpCfg.Username;
            tbPassword.Text         = _smtpCfg.Password;
            cbUseCredential.Checked = _smtpCfg.UseCredential;
            nbRitardoSecondi.Value  = _smtpCfg.RitardoSecondiInvio;
        }