Beispiel #1
0
        public void SendMails(EmailSendService emailSender)
        {
            this._emailSender = emailSender;

            _timer.Tick    += TimerTick;
            _timer.Interval = new TimeSpan(0, 0, 1);
            _timer.Start();
            MessageAfterPlanning?.Invoke("Отправка писем запланирована");
        }
        /// <summary>
        /// Отправка писем
        /// </summary>
        /// <param name="dtSend"></param>
        /// <param name="emailSender"></param>
        /// <param name="emails"></param>
        public void SendMails(DateTime dtSend, EmailSendService emailSender)
        {
            this.dtSend      = dtSend;
            this.emailSender = emailSender;

            timer.Tick    += Timer_Tick;
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Start();
        }
Beispiel #3
0
        private void BtnSendEmail_Click(object sender, RoutedEventArgs e)
        {
            // Список адресов для рассылки.
            List <string> listStrMails = Constants.listStrMails;

            string strPassword = passwordBox.Password;
            string senderEmail = Constants.SENDER_EMAIL;

            string subject = tbSubject.Text;
            string body    = tbBody.Text;

            foreach (string recieverEmail in listStrMails)
            {
                var mail = new EmailSendService();
                mail.Send(senderEmail, strPassword, recieverEmail, subject, body);
            }

            SendEndWindow sew = new SendEndWindow
            {
                Owner = this
            };

            sew.ShowDialog();
        }