• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1468
  • Last Modified:

In html mailto can you pass a subject line or message body to gmail?


I've been able to use Google Notifier to get mailto links to open up gmail as the default mail client using:
<a href="mailto:matt@jajkowski.com">Send email</a>

However, if I try passing:
<a href="mailto:matt@jajkowski.com??body=I am having trouble finding information on ">Send email</a>
only the body will show up but no email.  

Does gmail only allow one variable to be passed through a link?  am I doing something wrong?

My company uses google apps and would very much like to stay away from using Outlook (which I believe i've used in the past to pass the TO/SUBJECT/BODY.

Any help would be appreciated!!

  • 5
  • 3
1 Solution
This works for setting the subject automatically:
<a href="mailto:email@address.com?subject=Remove my child" rel="nofollow">contact us</a>

SO perhaps too many "?" in the mailto?

Specifies using only a single question mark and also linking multiple fields by using ampersands:

<a href="mailto:astark1@unl.edu?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node">

Open in new window

nrking83Author Commented:
Thanks for your quick responses! I Hawarden the second ? was left over from copy and paste, I also used the linked website with no luck. However, the examples do work for outlook.

With all the examples I'll get something transferred into gmail whether its recipient, subject line, CC, or body.  But it will only take one of the those fields and wont take all of them.  
Its possible that gmail google apps may not take more than one input or either program wont pass on all the fields (to, subject, body).  I may have to make them all go back to outlook to make this work.  
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hmmm, may I ask what browser you guys are using? I have gmail in firefox, with gmail set to be my firefox mailto handler, so I'm not sure what piece of your puzzle I am missing....

<a href="mailto:myemail@mydomain.com?subject=Testing my gmail&body=test test test" rel="nofollow">contact us</a> opened my gmail with a new email with subject/body containing what I expected to see there...
The Google Mail Checker Plus extension sounds like it might do the trick for Chrome.

This link might be helpful as well.
nrking83Author Commented:
We primarily use IE7 or 8.  Seems the exact same thing happends when I use firefox too.  I used the Addon Google Notifier and it still pulls the same things.  Using your exact example:
<a href="mailto:myemail@mydomain.com?subject=Testing my gmail&body=test test test" rel="nofollow">contact us</a>

It only passes subject and body, but not email address.  I've tried using google talk, google notifier, using firefox and IE.

It might help if I explain what I'm trying to accomplish.  We have a database app written in classic asp of people, on the view page for each person there is a link "send email" that is a mailto link.
This is the exact code that works:
<a href="mailto:<% =rs("bemail") %>">Send Email  via GMAIL</a>
What i'd like to do is:
<a href="mailto:<% =rs("bemail") %?body=http://domain.com/file.asp?page=make_appt&rid=<% =rs("rid") %>">Send Email to Bride and Groom via GMAIL</a>

So far I'm having very little luck.
Just out of curiosity, what does your firefox have as its mailto handler?

On another note, most of the pages I have seen say that MS apps default to outlook/outlook express and don't have a mechanism to force that. Chrome, FF, and other non-MS browsers give the option of manually specifying the mailto handler, but the OS itself doesn't. I tried to configure the default mail client on the IE options menu, and the only choices I am given are stand-alone apps.

You know... I am looking at your code and I am wondering if it could be something as trivial as the placement of the >s. You lifted that code straight out of your program? There is a > missing in front of the first ?.

<a href="mailto:<% =rs("bemail") %>?body=http://domain.com/file.asp?page=make_appt&rid=<% =rs("rid") %>">Send Email to Bride and Groom via GMAIL</a>

I assume you have tried it with hard-coded text in the mailto, instead of the variables?
nrking83Author Commented:
I tried everything and one way or another I couldnt get to, subject, and body to ALL load.  So I bypassed google talk and google notifier by linking directly to google apps gmail.

This is the end result:

This works out much better because I wont have to modify any settings on multiple computers.  

Thanks for all your help I appreciate it!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now