Regarding the following code:
Vb.net Code:
Private Sub bgw_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgw.DoWork
Try
Dim testEmail As New NetEmail("
[email protected]", TextBox4.Text.Trim, TextBox5.Text.Trim, TextBox6.Text.Trim, TextBox7.Text.Trim)
testEmail.Timeout = 10000
testEmail.EnableSSL = CheckBox1.Checked
testEmail.AddMessage("Test message")
btnNext.Enabled = True
bgw.ReportProgress(100)
Catch ex As Exception
bgw.ReportProgress(0, ex)
btnNext.Enabled = False
End Try
End Sub
Private Sub bgw_ProgressChanged(ByVal sender As System.Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles bgw.ProgressChanged
If e.ProgressPercentage = 0 Then
Dim CaughtEx As Exception = DirectCast(e.UserState, Exception)
MessageBox.Show(CaughtEx.Message)
MessageBox.Show("Your email settings were not configured")
ElseIf e.ProgressPercentage = 100 Then
MessageBox.Show("Test Successfull")
End If
End Sub
if an exception is thrown, the first messagebox is showing the the Exception message. The second messagebox Is NOT SHOWN.
if it is succesfull THE MESSAGE BOX is still NOT SHOWN?
does anyone know whatsup?