private void FromCombo_SelectionChanged(object sender, SelectionChangedEventArgs e) { FromBox.Text = ""; ToBox.Text = ""; FromBox.Focus(); ConvColLabel.Background = null; }
private TextBox Focused() { if (Color1Tb.Focus()) { return(Color1Tb); } else if (Color2Tb.Focus()) { return(Color2Tb); } else if (FromBox.Focus()) { return(FromBox); } else { return(Color1Tb); } }
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; } }
private void FromBox_MouseDown(object sender, MouseButtonEventArgs e) { FromBox.Focusable = true; FromBox.CaretIndex = FromBox.CaretIndex; FromBox.Focus(); }