Skip to content

Instantly share code, notes, and snippets.

@johnmichel
Created April 14, 2010 15:24
Show Gist options
  • Select an option

  • Save johnmichel/365922 to your computer and use it in GitHub Desktop.

Select an option

Save johnmichel/365922 to your computer and use it in GitHub Desktop.
A mostly-spamproof way of letting people compose an email to you
// Usage:
// <a href="javascript:mail('hello','gmail','com','email!','this begins the message ')">Email Me</a>
function mail(user, host, tld, subject, message)
{
email = 'mailto:' + user + '@' + host + '.' + tld + '?subject=' + subject + '&body=' + message;
window.location = email;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment