Providing info email or contact email in plain text helps spammer (robots) to extract the email using regex or any technique, currently I provided an image like this:

enter image description here

But this method has usability issue because users with enabled default email can't click it and start sending email using default mail sender, also, user can't even copy address and paste it.

Then, what is the best approach to provide email address?

  • Let your email provider handle the spam for you. (Though to be fair, Gmail is probably the only provider that's any good in this regard.) Jul 20 '13 at 22:57

Having tried a bunch of different methods in the past, my answer, at least as far as "unspammable" goes, would be "You can't."

Even with your image technique, or no matter what else you do, as soon as somebody does e-mail you they'll have your address in their address book. And then they'll get infected by a virus that steals their address book and sends it to a spammer.

Frankly, if it's your own address, I wouldn't even bother. Just set up a separate e-mail account for your web-related e-mails and use a good adaptive spam filter on it. Remember to occasionally skim your spam folder for false positives.

If you're dealing with addresses belonging to other people (e.g. your users), it does seem prudent to exercise a little extra care. In fact, the first question I'd ask myself is whether you even need to reveal your users' e-mail addresses in the first place. You can always implement an "e-mail another user" feature on your site without actually revealing the recipient address to the sender. At the very least, I'd say that making their e-mail address public should always be optional (and opt-in, not opt-out) for the user.

I would also suggest that you probably shouldn't show a user's e-mail address to anyone who isn't also a registered user of your site. This may not stop all address harvesters, but it should stop the majority of them. Preferably, you should also use a good CAPTCHA as part of your account registration process, and you may also want to wait until a new user has participated enough on your site to confirm that they're not a bot before granting them access to abusable features such as other users' addresses.

  • The problem here is not related to registered user, I am talked about general issue when providing plain text of contact email, if you review themeforest and go to wordpress themes, you can see that most of them provided contact email in all pages and in plain text without any protection from spam...
    – Akam
    Jul 21 '13 at 11:37
  • In that case, ignore the lower part of my answer. Jul 21 '13 at 11:45

Have you thought about JavaScript obfuscation? There are a few different ways of achieving that, one service which would provide the output for you is hivelogic.


Rather than have a email address on your site, I would suggest using a form that users can use to contact you. A contact form is much better at spam control than email:

  • Sale value: An email address can be found and sold to spammers, a contact form cannot.
  • Automation: An email address can be discovered in the page and bot spammed. An effective contact form won't allow bot submissions. Features such as hidden field that shouldn't be filled out, disallowing html markup in the message, and captcha on my contact form stop all bot submissions for me.

In addition contact forms allow you to prompt the user for specific fields and validate that their responses match a valid pattern. While contact forms can be configured to be free-form, email is always free-form.

I am the author of a free, open source contact form that you can use on your website.

  • Thanks, my goal is best way to provide plain text email without spammer be able to extract it :)
    – Akam
    Jul 21 '13 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.