Gmail web client not handling mailto body parameter correctly

I’m having trouble with Gmail’s web interface when clicking on mailto links that include message body text. The links work perfectly fine when they only contain a subject line, but as soon as I add the body parameter with the ampersand separator, Gmail stops processing them correctly.

Here’s what I’m experiencing:

href="mailto:[email protected]?subject=Hello&body=Thanks for your help" - This breaks in Gmail

href="mailto:[email protected]?subject=HelloThanks for your help" - This works but puts everything in the subject field

I’ve tested this across multiple browsers including Firefox, Chrome, and Internet Explorer on Windows. Interestingly, the same email messages display differently between my regular Gmail account and my Google Workspace account. When I check these same mailto links on my mobile device or in Outlook desktop, they function as expected.

Has anyone else run into this issue? Is there a workaround for getting Gmail web to properly parse the body parameter in mailto URLs?

Yes, this issue with the Gmail web client is quite common. I’ve faced similar situations while setting up email processes. The key thing to remember is that Gmail doesn’t always parse mailto links according to expected specifications, which can lead to inconsistent behavior.

To make your mailto links work, ensure that you encode the URL correctly, especially avoiding any special characters in the body. For line breaks, use %0A and for paragraphs, use %0D%0A instead of relying on regular formatting. Additionally, be cautious with the length of your message as there appears to be an undocumented limit that can cause Gmail to ignore longer texts. A reliable workaround is to construct your mailto links dynamically with JavaScript, as this often circumvents the parsing issues faced when hardcoding them into HTML.

I encountered a similar issue while developing a contact form for my site. Gmail’s handling of mailto link parameters tends to be inconsistent, which can be frustrating. What worked for me was to ensure that all components of the link were properly URL encoded, particularly the body text. Remember to use %20 for spaces and %26 for ampersands. Additionally, be aware that Gmail’s web interface has undocumented character limits on the body parameter, which can cause longer messages to be truncated or ignored. I’ve found that desktop email clients manage this much more effectively than the web version.

yep, gmail’s super picky with mailto links. url encoding the body usually fixes it - just double check ur ampersands are right. often it’s something small but drives u crazy!