How to open the Gmail app on mobile instead of the browser using a mailto link?
I want to create a feature where clicking a link opens the Gmail app on mobile devices (instead of the browser). The link should pre-fill the recipient’s email, subject, and body.
I tried using a basic mailto link:
<a href="mailto:someone@example.com?subject=Test%20Subject&body=This%20is%20a%20test%20email">Send Email</a>
This works, but on some devices, it opens the browser instead of the Gmail app.
For Android, I tried using an intent link:
<a href="intent://compose?to=someone@example.com&subject=Test%20Subject&body=This%20is%20a%20test%20email#Intent;scheme=mailto;package=com.google.android.gm;end;">Send Email</a>
However, this doesn’t seem to work consistently across devices.
Was expecting when the user clicks on it in mobile devices it should take him to his app rather than web