private void Button_Click(object sender, RoutedEventArgs e) { try { text = text_bx.Text; subjectCurl = subjct_cmb.SelectedItem.ToString(); subject = subjectCurl.Remove(0, subjectCurl.IndexOf(':') + 1); MailSendMessage mail = new MailSendMessage(text, subject); mail.SendMessage(); BOX.ShowInformation("Message was sended"); text_bx.Text = string.Empty; subjct_cmb.SelectedIndex = -1; } catch (NullReferenceException) { BOX.ShowInformation("Subject are not Select"); } }
private void Button_Click(object sender, RoutedEventArgs e) { string messtoclient = "Your e-mail was linked to CGAAF Platform, if you didn’t send us Request - please let us know by e-mail"; MailSendMessage MessToClient = new MailSendMessage(messtoclient, "Hardware Acces", txb_Mail.Text); try { MessToClient.SendMessageClientMail(); } catch (Exception ex) { BOX.ShowInformation(ex.Message); } string texttoadminsupport = "Client : " + txb_FName.Text + " " + txb_LName.Text + "needs approval of their equipment ID : " + ID_Hardware.Content; MailSendMessage MessToSupport = new MailSendMessage(texttoadminsupport, "Needs Approval of Hardware"); try { MessToSupport.SendMessage(); } catch (Exception ex) { BOX.ShowInformation(ex.Message); } BOX.ShowInformation("Message was sent."); this.Close(); }