/// <summary> /// Send the exception report using the configured send method /// </summary> public async Task SendReport() { View.EnableEmailButton = false; View.ShowProgressBar = true; var sender = new SenderFactory(ReportInfo, View).Get(); View.ProgressMessage = sender.ConnectingMessage; try { await Task.Run(() => { //string command = "mailto:info[at]codegain.com?subject=The Subject&bcc=vrrave[at]codegaim.com"; //System.Diagnostics.Process.Start(command); var report = ReportInfo.IsSimpleMAPI() || ReportInfo.SendMethod == ReportSendMethod.Mailto? CreateEmailReport() : CreateReport(); sender.Send(report); }); } catch (Exception exception) { // most exceptions will be thrown in the Sender - this is just a backup View.Completed(false); View.ShowError(string.Format("Unable to setup {0}", sender.Description) + Environment.NewLine + exception.Message, exception); } finally { if (ReportInfo.IsSimpleMAPI()) { View.MapiSendCompleted(); } } }
/// <summary> /// Send the exception report using the configured send method /// </summary> public void SendReport() { View.EnableEmailButton = false; View.ShowProgressBar = true; var sender = new SenderFactory(ReportInfo, View).Get(); View.ProgressMessage = sender.ConnectingMessage; try { var report = ReportInfo.IsSimpleMAPI() ? CreateEmailReport() : CreateReport(); sender.Send(report); } catch (Exception exception) { // most exceptions will be thrown in the Sender - this is just a backup View.Completed(false); View.ShowError(string.Format("Unable to setup {0}", sender.Description) + Environment.NewLine + exception.Message, exception); } finally { if (ReportInfo.IsSimpleMAPI()) { View.MapiSendCompleted(); } } }
/// <summary> /// Send the exception report using the configured send method /// </summary> public void SendReport() { View.EnableEmailButton = false; View.ShowProgressBar = true; var sender = new SenderFactory(ReportInfo, View, new WinFormsScreenShooter()).Get(); View.ProgressMessage = sender.ConnectingMessage; try { var report = ReportInfo.IsSimpleMAPI() ? new EmailReporter(ReportInfo).Create() : CreateReport(); sender.Send(report); } catch (Exception exception) { View.Completed(false); View.ShowError(Resources.Unable_to_setup + $" {sender.Description}" + Environment.NewLine + exception.Message, exception); } finally { if (ReportInfo.IsSimpleMAPI()) { View.MapiSendCompleted(); } } }