Basically OverrideURL is the sub that's called before the page is loaded. So the order of operations is:
Link is pressed in webview -> OverrideURL -> New url is loaded -> PageFinished
So what you want to do is intercept all hyperlinks that start with "mailto:" within the OverrideURL sub.
This is easily done, like so:
Sub OverrideURL (Url As String)
If url.IndexOf("mailto:") > -1 Then
'Do what you want with the mailto link
End If
End Sub
So now that you know the link pressed is a mailto link you can work with it.
Use the phone library (that is, check the "Phone" library in the IDE) for Email like so:
Dim Message As Email
Message.To.Add(url)
Message.Body = "Email body"
StartActivity(Message.GetIntent)
Bare in mind you need to strip the "mailto:" part from the Url string as well:
url.replace("mailto:","")
Altogether now!
Sub OverrideURL (Url As String)
If url.IndexOf("mailto:") > -1 Then
Dim Message As Email
Message.To.Add(Url.replace("mailto:",""))
Message.Body = "Email body"
StartActivity(Message.GetIntent)
End If
End Sub
I don't have an answer for the numbers question although I imagine the solution will be quite similar.