Exemplo n.º 1
0
 private void FromCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     FromBox.Text = "";
     ToBox.Text   = "";
     FromBox.Focus();
     ConvColLabel.Background = null;
 }
Exemplo n.º 2
0
 private TextBox Focused()
 {
     if (Color1Tb.Focus())
     {
         return(Color1Tb);
     }
     else if (Color2Tb.Focus())
     {
         return(Color2Tb);
     }
     else if (FromBox.Focus())
     {
         return(FromBox);
     }
     else
     {
         return(Color1Tb);
     }
 }
Exemplo n.º 3
0
        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                string[]    Addresses = ToBox.Get(context).Split(';');
                MailAddress From      = new MailAddress(FromBox.Get(context), FromName.Get(context));
                MailMessage Message   = new MailMessage();

                foreach (string addr in Addresses)
                {
                    Message.To.Add(addr);
                }

                Message.Subject    = Subject.Get(context);
                Message.Body       = Body.Get(context);
                Message.IsBodyHtml = true;
                Message.From       = From;

                int        SMTP   = Convert.ToInt32(SMTPServer.Get(context));
                SmtpClient Client = new SmtpClient(SMTPServer.Get(context), SMTP);
                Client.Credentials = new NetworkCredential(FromBox.Get(context), MailPassword.Get(context));

                string[] AttachedFiles = Attachments.Get(context);
                if (AttachedFiles.Length > 0)
                {
                    foreach (string file in AttachedFiles)
                    {
                        if (!string.IsNullOrEmpty(file))
                        {
                            Message.Attachments.Add(new Attachment(file));
                        }
                    }
                }

                Client.Send(Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
        }
Exemplo n.º 4
0
 private void FromBox_MouseDown(object sender, MouseButtonEventArgs e)
 {
     FromBox.Focusable  = true;
     FromBox.CaretIndex = FromBox.CaretIndex;
     FromBox.Focus();
 }