MD Spam Me Not

An email obfuscator that works even with Javascript disabled

Download MD Spam Me Not 1.0.4

This version posted March 7, 2009
This ExpressionEngine add-on is available at GitHub.
Visit the GitHub page and click "Download", and then click either "Zip" or "Tar".

Overview

I know EE has the built in “encode” for masking email addresses but I’m one of those people who really like things to work whether or not the user has Javascript enabled. My goal was to make port an email obfuscator that worked even with Javascript disabled.

I just started using EE for most sites. Before, I used to have a config.php file that had all my handy functions in it – one of which was obfuscateEmail(); which ran a bit of PHP (see http://www.zapyon.de/ for the basis of what is happening in this plugin) to encode the email address in decimal or hexadecimal mode. May not be the most robust email masking, but it has worked for me on numerous sites, and I’ve never had a client say they were getting too much spam. I wanted this to work in my EE sites, so I wrote my first plugin! (cue sound of 1 hand clapping…)

Release Notes

Version 1.0.4 (Mar 7, 2009):

  • Changed name (and function and class) to MD Spam Me Not (md_spam_me_not)

Version 1.0.3 (Sep 15 2007):

  • Added class and subject options (Thanks gleam, jejune)

Version 1.0.2 (Nov 17 2006)

  • 160 downloads

Parameters

The tag has six parameters:

1. email – The email address to obfuscate. [REQUIRED]
2. mode – 1 or 2. 1 = decimal mode and 2 = Hexadecimal [OPTIONAL, defaults to 1]
3. text – Text to display if different than the email address [OPTIONAL, defaults to showing the email address]
4. title – OPTIONAL
5. subject – OPTIONAL
6. class – OPTIONAL

Usage

Example usage (full):

{exp:md_spam_me_not email="ee@masugadesign.com" mode="1" title="My Title" 
class="nocion email" subject="EE Inquiry" text="Email Ryan for more info."

Example usage (basic):

{exp:md_spam_me_not email="ee@masugadesign.com"

Hope it works for you.

This entry was last updated June 30, 2009.


2 Comments

  1. 1. Mike Mella

    June 09th, 2009

    Hey Ryan.  This is a great plugin, thanks. 

    I was hoping to be able to use it in EE’s Email Contact Form as a way to encrypt {author_email} from spammers:

    http://expressionengine.com/docs/modules/email/contact_form.html#var_author_email

    ...But I noticed that it automatically turns emails into “mailto:” links so I can’t use it in a hidden “to” input field in the contact form.

    Any plans to add a mailto=“off” parameter?

  2. 2. Ryan Masuga

    June 30th, 2009

    I added the extra parameter that Mike suggested (newest version of the plugin is at GitHub).

    I’m closing the comments here due to spam.

Sorry, comments are closed.