Link to home
Start Free TrialLog in
Avatar of nrking83
nrking83Flag for United States of America

asked on

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

Hello,

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!!

Thanks,
Matt
Avatar of hawarden
hawarden
Flag of United States of America image

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?
http://www.ianr.unl.edu/internet/mailto.html

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

Avatar of nrking83

ASKER

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.  
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.
https://chrome.google.com/extensions/detail/gffjhibehnempbkeheiccaincokdjbfe

This link might be helpful as well.
http://www.google.com/support/forum/p/gmail/thread?tid=0519ceff60782b91&hl=en
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?
ASKER CERTIFIED SOLUTION
Avatar of nrking83
nrking83
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial