예제 #1
0
 private void buttonSend_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (mailMessage.Busy == false)
         {
             string t        = this.textBoxMailTo.Text;
             string lastFour = t.Substring(t.Length - 1, 1);
             if (lastFour == ";")
             {
                 string s = textBoxMailTo.Text.Substring(0, textBoxMailTo.Text.Length - 1);
                 textBoxMailTo.Text = s;
                 SendMail();
             }
             else
             {
                 SendMail();
             }
         }
         else
         {
             mailMessage.Abort();
             listBoxAttachments.Items.Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK);
     }
 }