email-bugs
email-bugs copied to clipboard
Gmail mobile removes breaklines when opened from a mailto link
I want to pass a body containing break lines \n
to my mailing app through a mailto
link.
Example :
<a
target="mailto"
rel="noopener noreferrer"
href="mailto:adrien.amoros%40gmail.com?body="Hello%0AContent%0ARegards"
>
Send email
</a>
When I click on that link on my phone, my Gmail app displays Hello Content Regards
with spaces instead of break lines.
It's not the case on my desktop.
How to Reproduce
- Create an
html
page containing the previous example. The objective is to have encoded\n
in the body of the email. - Open that link on an android phone which uses a Gmail app as main client. => That's it
Phone: android
Gmail app version: 2019.11.21.283644823.release
Just want to clarify - If adding a line break in a mailto link you can specify %0D%0A - then a new line will start. Just to clarify you want it to look like this? e.g.
Hello Content Regards
Hello,
The following example (using \r\n) is also broken.
<a
target="mailto"
rel="noopener noreferrer"
href="mailto:adrien.amoros%40gmail.com?subject=test&body=Hello%0D%0AContent%0D%0ARegards"
>
Send email
</a>
And yes I want it to look like this :)
e.g.
Hello Content Regards
Is that still a problem with gmail mobile?
I don't know, I have to test it again.
this is still a problem : |
Not justifying the bug, but it's worth pointing out that email clients need to sanitize mailto
links which is probably why this bug exists. The mailto
URI scheme allows a lot of parameters, some of which can be maliciously used. See: https://www.zdnet.com/article/some-email-clients-are-vulnerable-to-attacks-via-mailto-links/