How to get phone's default email client?

author

Member
Licensed User
Longtime User
Hi guys, my first post. Glad to meet y'all, etc.

I'm using the following code as a Share button:

B4X:
Sub mnuShare_click
   Message.To.Add("[email protected]")
   Message.Subject = "This is a test"
   Message.Body = WebView1.Url
   StartActivity(Message.GetIntent)
End Sub

works like I want except it does not bring up the default email client on my Droid 2 (does bring up Gmail which sends, G+, WordPress, & Facebook).

But this is an app for Market and I want it to get the email client that comes with the phone as well?

I've searched and read posts here and I've seen that others have had the problem but no solution I could find.

Any suggestions, please?

--Ralph
 

author

Member
Licensed User
Longtime User
OR I COULD do it like THIS and it would work exceptionally slick and precisely like I want!

B4X:
Uri="mailto: ?subject=Interesting link from Ralph&body=" & WebView1.Url
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW,Uri)
StartActivity(Intent1)

:sign0161:

same way I was doing it in App Inventor, actually.

puts the URL link in the body of the email.

now, all I need to complete the app is to get the webpage title BUT saw how to do that already.

--Ralph
 
Last edited:
Upvote 0
Top