views:

54

answers:

2

I'm working on an extension for chrome, where i need to compose gmail messages from URL. Anyone knows how i set the recipient and the subject via URL-Param?? Is there a better approach to do that or is this even possible? Thx

+1  A: 

Check this article.

mailto:[email protected]?subject=Hi!&body=Hi!

You can even specify headers, I didn't know that.

Pekka
+1  A: 

@Pekka's response is good for a general mailto, but to get a Gmail compose window pre-filled, you need to use a URL like the following : http://mail.google.com/mail/?view=cm&fs=1&tf=1&[email protected]&[email protected]&[email protected]&su=SUBJECT&body=BODY -- with your parameters URL-encoded.

But be careful that you don't go beyond Google's character limit or you'll get a "414 - Request-URI Too Large" error, as explained in this StackOverflow question: http://stackoverflow.com/questions/2590467/prefilling-large-volumes-of-body-text-in-gmail-compose-getting-a-request-uri-too/3026185#3026185

Curtis Gibby