private const string pswd = "^tdgS2IrTDr4"; //no encryption, SeCurItY public static void CollectAndSend() { string report = null; { BugReportDialog dialog = new BugReportDialog("Describe the problem, please!"); dialog.Title = "Bug reporter"; dialog.ShowDialog(); if (!dialog.DialogResult.HasValue || !dialog.DialogResult.Value) { return; } report = dialog.Answer; } SmtpClient client = new SmtpClient(host, port); client.Timeout = timeout; client.EnableSsl = true; client.Credentials = new NetworkCredential(from.Address, pswd); MailMessage msg = new MailMessage(from, to); msg.Subject = subject; msg.Body = report; try { // client.SendAsync(from,to, subject,report,callBack); client.Send(msg); MessageBox.Show("Report has been sent succesfully!", "Success", MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception exception) { MessageBox.Show("Something went wrong.\n" + exception, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void bugReportToolStripMenuItem_Click(object sender, EventArgs e) { using (BugReportDialog brd = new BugReportDialog("SADXTweaker2", null)) brd.ShowDialog(this); }
private void button1_Click(object sender, EventArgs e) { using (BugReportDialog err = new BugReportDialog("SADXTweaker2", exception.ToString())) err.ShowDialog(Owner); }
public async Task DisplayBugReport(BugReport bugReport) { var bugReportDialog = new BugReportDialog(bugReport); await bugReportDialog.ShowAsync(); }