private void SendErrorButton_Click(object sender, RoutedEventArgs e) { var m = new MailMessage(); var source = GetMetaContent(LogHelper.XLogHelperErrorSource); if (!string.IsNullOrEmpty(source)) { m.Headers.Add(LogHelper.XLogHelperErrorSource, source); } var errType = GetMetaContent(LogHelper.XLogHelperErrorType); if (!string.IsNullOrEmpty(errType)) { m.Headers.Add(LogHelper.XLogHelperErrorType, errType); } var errCode = GetMetaContent(LogHelper.XLogHelperErrorCode); if (!string.IsNullOrEmpty(errCode)) { m.Headers.Add(LogHelper.XLogHelperErrorCode, errCode); } m.Subject = SubjectTextBox.Text; if (!string.IsNullOrEmpty(FromEmailTextBox.Text)) { m.From = new MailAddress(FromEmailTextBox.Text); } m.To.Add(new MailAddress(ToEmailTextBox.Text)); m.IsBodyHtml = true; m.Body = GetBody(); var messages = new List <MailMessage>(); messages.Add(m); SendMessages?.Invoke(this, new EventArgs <List <MailMessage> >(messages)); }
private void SendErrorButton_Click(object sender, RoutedEventArgs e) { var message = new MailMessage(); message.Subject = SubjectTextBox.Text; if (!string.IsNullOrEmpty(FromEmailTextBox.Text)) { message.From = new MailAddress(FromEmailTextBox.Text); } message.To.Add(new MailAddress(ToEmailTextBox.Text)); message.IsBodyHtml = true; message.Body = GetBody(); var messages = new List <MailMessage>(); messages.Add(message); SendMessages?.Invoke(this, new EventArgs <List <MailMessage> >(messages)); }