Skip to content

Instantly share code, notes, and snippets.

@kbauer
Last active February 26, 2024 07:17
Show Gist options
  • Save kbauer/1b193299768768db470388550e665a56 to your computer and use it in GitHub Desktop.
Save kbauer/1b193299768768db470388550e665a56 to your computer and use it in GitHub Desktop.
javascript:/* MailToSelf */ (function(){target = "mailto:[email protected]?subject=" + encodeURIComponent(document.title) + "&body=" + encodeURIComponent(location.href); location.href = target;})()

On mobile devices, I often use "mail-to-self" type apps to quickly send me a webpage for later reading; Funnelling everything into my mailbox is simply the only way I will actually look at it again. On mobile, these apps integrate with the OS-provided "Share" menus, but on the desktop I had to manually write an email. Hence this bookmarklet, to automate creation of the reminder Email.

Installation

  1. Create a new bookmark.

  2. Edit the bookmark and copy/paste the javascript line at the beginning of this file as its URL field, replacing [email protected] by your actual email address.

Usage

For invoking the bookmarklet, you can either

  • Enable your browser's bookmark bar and put the bookmark there.

  • Name the bookmark in a manner, that can easily be accessed through the address/search bar.

    For Chrome, e.g. the name "mmm MailToSelf" works, which will appear as suggestion in the Omni-Bar when either starting to type "mailtoself" or typing "mmm". Note that chrome shows only the first THREE bookmarks matching the current input.

    The short-version "mmm" is especially useful on mobile devices, where Chrome has no bookmark interface, that can be used to trigger bookmarklets by clicking and typing out the full name is slow.

Gmail Hints

If you own "[email protected]", then Gmail treats every combination "[email protected]" as an alias to your address. In combination with filter rules, this can allow e.g. automatically applying labels to "mail-to-self" emails. For instance I use the email address

[email protected]

for this bookmarklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment