Nick
Nick

Reputation: 14283

How to use mailto on a mobile web app

I'm trying to use mailto from a web app that needs to work on mobile devices (angularjs with ionic framework), so that on click, it opens the default email app.

My first attempt was to use href="mailto:[email protected]" but that didn't work.

So, I did some reseach, and tried all the method I was able to find, but none of them worked.

Here's what I tried:

Then I also tried with onClick and javascript

They all works on a desktop, but none of them worked on Android (can't test iOS at the moment)

How can I achieve this? mailto to work on desktop, ios and android? Thanks a lot.

PS: If it helps, I'm building the app using cordova and I'm also using crosswalk

Thanks for any help

Upvotes: 2

Views: 4253

Answers (1)

johnborges
johnborges

Reputation: 2533

The first option you listed should work. Make sure your config.xml has en entry for something like this:

<allow-intent href="mailto:*" />

This will ensure that mailto is handled by your whitelist.

Upvotes: 1

Related Questions