Skip to content

Instantly share code, notes, and snippets.

@nrn
Created December 25, 2012 21:12

Revisions

  1. nrn created this gist Dec 25, 2012.
    5 changes: 5 additions & 0 deletions mailTo.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    javascript:(function () {
    var selected = getSelection().toString();
    if (selected !== "") selected = '"...\n'+selected+'\n..."\n';
    location.href = 'mailto:?SUBJECT='+encodeURIComponent(document.title)+'&BODY='+encodeURIComponent('\n'+location.href+'\n'+selected);
    })()