1

I want to create a url link that, when clicked, will open the gmail page in the compose mode, with pre-filled data (subject, message body). But it need to work also for mobile version. I know that is possible to create such a link, the problem is that it only works on the desktop version. It does not work on the mobile (iOS).

https://mail.google.com/mail/?view=cm&fs=1&to=someone@example.com&su=SUBJECT&body=BODY&bcc=someone.else@example.com

Answer 1 Answer 2

Is it possible to create a link that will also support mobile versions and through which I can pass the initial content of the message?

ambussh
  • 740
  • 1
  • 7
  • 18

1 Answers1

0

Firstly you cannot force a link to open Gmail iOS app since not all users have Gmail installed on there iPhone.

To open the "default" mail app set in the settings with a link and already have pre-filled fields you need to use the mailto syntax, example:

<a href="mailto:contact@my-website.com?subject=Big%20News&body=Hi,%0D%0A%0D%0A">Send me an E-mail</a>

Multiples fields can set: subject, body, cc, bcc

More details form the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks#e-mail_links

Ben Souchet
  • 1,450
  • 6
  • 20
  • Thank you for your answer, but that's not what I'm looking for. I do not want to open the Gmail application (or any other application) but open the gmail page with the prefilled data (which works on the desktop) – ambussh Jan 10 '22 at 12:47