private void ButtonSend_Click(object sender, RoutedEventArgs e)
        {
            WpfTestMailSender.Server = TextBoxServer.Text;
            WpfTestMailSender.Port   = Int32.Parse(TextBoxPort.Text);
            string from         = TextBoxFrom.Text;
            string to           = TextBoxTo.Text;
            string subject      = TextBoxSubject.Text;
            string body         = TextBoxBody.Text;
            var    emailService = new EmailSendServiceClass(TextBoxLogin.Text, PasswordBoxPassword.SecurePassword);

            emailService.SendMail(from, to, subject, body);
        }
Ejemplo n.º 2
0
        private void BtnSendNow_OnClick(object sender, RoutedEventArgs e)
        {
            EmailSendServiceClass       emailSender = CreateEmailSendService();
            Dictionary <string, string> emails      =
                ((IQueryable <Email>)dgEmails.ItemsSource).ToDictionary(k => k.Email1, p => p.Name);

            if (emailSender != null)
            {
                emailSender.ShowResultOfSend += SendEndWindowCreate;
                new Thread(() => { emailSender.SendMail(emails); }).Start();
            }
        }