@@ -34,6 +34,7 @@ public CrashReport(ReportCrash reportCrashObject)
3434 pictureBoxScreenshot . ImageLocation = _reportCrash . ScreenShot ;
3535 pictureBoxScreenshot . Show ( ) ;
3636 }
37+
3738 if ( _reportCrash . DoctorDumpSettings != null &&
3839 _reportCrash . DoctorDumpSettings . SendAnonymousReportSilently )
3940 _reportCrash . SendAnonymousReport ( SendRequestCompleted ) ;
@@ -87,7 +88,6 @@ private void ButtonSendReportClick(object sender, EventArgs e)
8788 var regexEmail = new Regex (
8889 @"^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$" ) ;
8990 string from = String . Empty ;
90- string subject = String . Empty ;
9191
9292 if ( string . IsNullOrEmpty ( textBoxEmail . Text . Trim ( ) ) )
9393 {
@@ -99,26 +99,24 @@ private void ButtonSendReportClick(object sender, EventArgs e)
9999 }
100100 else
101101 {
102- errorProviderEmail . SetError ( textBoxEmail , "" ) ;
103- if ( ! regexEmail . IsMatch ( textBoxEmail . Text . Trim ( ) ) )
102+ if ( regexEmail . IsMatch ( textBoxEmail . Text . Trim ( ) ) )
103+ {
104+ errorProviderEmail . SetError ( textBoxEmail , "" ) ;
105+ from = textBoxEmail . Text . Trim ( ) ;
106+ }
107+ else
104108 {
105109 if ( _reportCrash . EmailRequired )
106110 {
107111 errorProviderEmail . SetError ( textBoxEmail , Resources . InvalidEmailAddressError ) ;
108112 return ;
109113 }
110114 }
111- else
112- {
113- errorProviderEmail . SetError ( textBoxEmail , "" ) ;
114- from = textBoxEmail . Text . Trim ( ) ;
115- subject =
116- $ "{ _reportCrash . ApplicationTitle } { _reportCrash . ApplicationVersion } Crash Report by { textBoxEmail . Text . Trim ( ) } ";
117- }
118115 }
119116
120- _reportCrash . SendReport ( checkBoxIncludeScreenshot . Checked , SendRequestCompleted , SmtpClientSendCompleted , this , from , subject , textBoxUserMessage . Text . Trim ( ) ) ;
121-
117+ _reportCrash . SendReport ( checkBoxIncludeScreenshot . Checked , SendRequestCompleted , SmtpClientSendCompleted ,
118+ this , from , textBoxUserMessage . Text . Trim ( ) ) ;
119+
122120 _progressDialog = new ProgressDialog ( ) ;
123121 _progressDialog . ShowDialog ( ) ;
124122 }
0 commit comments