Mailto Compose In GMail (with choice)

By cigno5.5 Last update Sep 7, 2005 — Installed 8,423 times.

Post doesn't exist

Archived Comments (locked)

in
Subscribe to Archived Comments 38 posts, 24 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
pandaking User

Would be nice if it did it next to text email addresses too...

 
Bill Brandt User

Great script. I did notice an issue. If the subject, body, etc. have special characters in them, things get messed up. A solution seems to be putting the nameValue[2]'s inside escape(). For example:

line 83:

emailSubject = escape(nameValue[2]);

I actually did this for To (76), CC (79), Subject (83), and Body (87)to be on the safe side. I'm guessing the To and CC can't have too many special characters because of the requirements for a valid email address, but it doesn't seem to hurt.

 
pandaking User

Awesome script, thanks! :)

 
Eladio Caritos User

I'm trying to edit this script so that I already have a body included. The problem that I am having is that is does not support multiline when assigning the string to the emailBody variable.

emailBody = "hello";
// I've tried '\n', '\\n', "\n", "\\n" as well
emailBody += "%0D";
emailBody += "world";

Correct Output:

hello
world

Any suggestions to correct this would be great.

 
Joe Klemmer User

This script is awesome. And I like the modifications that Hemal Pandya and Blake West made to the base script. The option of having the gmail composer popup is quite convenient. If there were a way to have the "process the page on demand" functionality Hemal wrote could be a toggle (right now it only sets to on). Maybe I'll learn javascript and try hacking it myself. Heh, right. Like that's gonna happen.

 
Blake West Scriptwright

I made a couple small edits to my copy of the script that move the gmail icon to the right of the mailto: link and also open the compose window as a popup that will auto-close after you click send.

I modified these two lines in the script...
eval("gmailIcon.addEventListener('click', function() { GM_openInTab(" + emailUrlVarName + "); return false; }, true);");
mailtoLink.parentNode.insertBefore(gmailIcon, mailtoLink);

...to look like this...
eval("gmailIcon.addEventListener('click', function() { window.open(" + emailUrlVarName + ", \'gmail\',\'width=600,height=700\'); return false; }, true);");
mailtoLink.parentNode.insertBefore(gmailIcon, mailtoLink.nextSibling);
gmailIcon.parentNode.insertBefore(document.createTextNode(' '),gmailIcon);

Thanks for the script, cigno5.5! Just what I needed at work.

 
Mauri User

in firefox 2.0, once i finish composing an email, the tab won't close automatically as it did before. how can I solve this?

 
Adam Victor ... User

It doesn't work with Geasemonkey on Epiphany Web Browser, unfortunately. I think you don't bother a lot about these weird browsers, but I bet it's noteworthy anyway :p

 
Estevam Moreira User

Doesn't work in my greasemonkey 0.6.5.20060727 and firefox 1.5.0.6.

 
theaulddubliner Scriptwright

If you go to http://software.hixie.ch/utilities/cgi/data/data you can upload an image of your choice and encode it for the script. Select 'base64' at the top. Browse to your image and then select 'generate'. Copy the result [very long line]. Open the script in a text editor. Scroll down to 'gmailIcon.src = ' and replace what follows with your new code. Make sure the new image code is between "" and is followed by ;

hope this works

 
Uzd4ce User

It also appears to not recognized MAILTO tags that where the HTML is written in all uppercase. That also sounds like something I could tweak on my own if someone could give me a hint with the javascript.

 
Uzd4ce User

I really like the choice aspect of this script, but the Gmail icon can get a little annoying if the page has multiple mailto links. I'd like to modify the script to display something in text, maybe just a G or even just a * before the link. Can anyone suggest the script edits that would be needed to do this?

 
Hemal Pandya User

Changing the last line from 'processMailtoLinks();' to 'GM_registerMenuCommand("mailto=gmail", processMailtoLinks)' does exactly that. My first modification of a userscript. Yay!

 
cigno5.5 Script's Author

i appreciated all of yours suggestions...it's not a tecnical problem implements the suggested features...it's a time problem!! :(
I hope that i'll can examine modifications in few days/weeks. I'm sorry!

 
Hemal Pandya User

This script is accellent, but I would like it to process the page on demand, not always. Maybe there can be a button somewhere on the page or better still a menu option that triggers the insertion of gmail links. This will achieve two things:
- save processing, most often you don't click on the mailto links and most pages have them
- preserve the original layout.

But I will use the script even if you don't make these changes :-)

 
Johnny User

The default exclude of http://gmail.google.com didn't work for me. Changing it to http://mail.google.com/* and https://mail.google.com/* did the trick.

 
Bitt Faulk Scriptwright

I've modified the script so that browsers won't add a line break between the icon and the mailto link text. Would anyone like to see the diff?

 
Mozmonster User

I already posted this at the Ideas page, but have received no responses. Is it possible for a GM script to automatically search and convert webpage text strings such as "sendmenospamplease AT hotmail DOT com", "sendmenospamplease at yahoo dot co dot uk", or "sendmenospamplease at ibm net" into clickable mailto links? Ideally, this script would search for patterns with phrases such as "at" and "com" or "net" in close proximity. Nearby marking words and phrases that alert GM to a hidden e-mail address can include "send me", "private me", "PM", "message me". Or the pattern could be "at" then followed by any of the major email or webmail providers (gmail, aol, earthlink, etc...) It would be a PLUS also to have a Gmail/Yahoo mailto icon added after the "re-assembled" e-mail address. All this would make it a convenient one-click access to write to e-mail addresses which were written to avoid spambot harvests. What you do think?

 
slam dunk User

cigno5.5,

Can you also make it Opera compatible. I tried the script in opera and it gave me type mismatch error. Works fine in Firefox1.5.

name: TypeError
message: Statement on line 51: Type mismatch (usually a non-object value used where an object is required)
Backtrace:
Line 51 of User JS script
var res = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
Line 124 of User JS script
processMailtoLinks();

 
slam dunk User

Thanks for a good script. Finally I found it was trying to write my own but gmail api is hard to understand. For my personal use I would want to add additional functionality to your script.

1. Want to add a hardcoded file attachment variable. With hardcoded file path, so that I don't have to browse and locate file to attach in Compose window.

2. Want an IFrame at bottom of Compose box displaying mail search results of recent mail sent/received to/from the mailto(To:) email address.

3. Asking too much now. Clicking the mailto icon should paste my custom text message in body of email compose window. Or add a dropdown listbox on top to selectively paste text from one of my custom templates.

-slamdunk

 
John 2 User

good one! the only problem is it's gonna make me stop using Thunderbird and my ISP e-mail! ;-p

 
ycc2106 Scriptwright

Thanks !

 
m3nth Scriptwright

This needs the secure gmail url (https) added as a default to the exclude list.

 
cigno5.5 Script's Author

ycc2106, you must simply go to http://www.userscripts.org/scripts/show/595
this is the original script that i got inspiration!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel