Sub ReportError(pName As String, Ver As String, inetAddress As String)
Dim ex As ExceptionEx 'from the Threading library
Dim error,ptype As String 'the error string and phone type info
Dim mail As Email 'built in email type
ex.Initialize(LastException.Message)
ptype = ph.Manufacturer & " " & ph.Model & CRLF & pName & " version " & Ver & CRLF
error = ptype & CRLF & ex.ToString & CRLF & CRLF & ex.StackTrace & CRLF
If Msgbox2("An error has occurred. The error is : "&LastException.Message&". Please report this error below.","ERROR","Report","","Dismiss",Null) = DialogResponse.POSITIVE Then
mail.Attachments.Clear
mail.Subject= pName & " error" 'Example: Virtual Dyno error
mail.To.Add(inetAddress)
mail.Body= error
StartActivity(mail.GetIntent) 'calls the intent to show the email client
End If
End Sub