How do I make mailto subject and body work in gmail etc?
Asked Answered
C

1

12

Good afternoon,

I have a site with a mailto link used to email my mothers business, pretty standard stuff

I recently tried adding some other bits to get a standard subject and body, which works find when I use outlook (on my work PC) but doesn't work if I use my home PC which automatically opens gmail:

The code I have for the mailto is:

<a href="mailto:[email protected]
&subject=Childminding%20query
&body=Dear%20Jo,%0A%0AYour%20message%20here%0A%0ARegards,%0A%0AName:%0AEmail:%0APhone:%0A" 
style="text-align:center;">[email protected]</a><br /><br />

(it is all on one line, but that makes it very tedious to read on here)

As I said, it works fine when the computer is forced to automatically open outlook, but not so much for gmail, is there a different method that would make it better for both?

Result in gmail:

https://static.mcmap.net/file/mcmap/ZG-Ab5ovKRkQZV0nc79QWRft/6L7bCaD.png

Corri answered 10/1, 2014 at 13:16 Comment(2)
try a ? instead of the first ampersand &subject -> ?subjectBennet
SUCCESS I knew it'd be something simple, thanks very muchCorri
C
18

As in the comment above, changing the ampersand into a question mark:

a href="mailto:[email protected]
?subject=Childminding%20query
&body=Dear%20Jo,%0A%0AYour%20message%20here%0A%0ARegards,%0A%0AName:%0AEmail:%0APhone:%0A" 
style="text-align:center;">[email protected]</a><br /><br />

Thanks!

enter image description here

Corri answered 10/1, 2014 at 13:50 Comment(1)
hi, I have added above code but gmail not supporting it : Screenshot : prntscr.com/k1ueudAndeee

© 2022 - 2024 — McMap. All rights reserved.