Search code examples
htmlemailsecurityobfuscationspam

What is the correct way to obfuscate an email address when posting it on a website in 2020?


I apologize in advance if this is not the right place to post this.

I am looking for the ideal and correct way to publish an email address on the web and keep it safe.

I searched these forums and I found a similar question but is it more than 10 years old so perhaps there are newer better ways to do this in the present.

Thank you!


Solution

  • You really only have two choices:

    • Block the spam

    Get a commercial (normally "full domain") spam filter. If you are using a gmail or other free/nearly-free address, forget about it - you can't put in a proper filter. A quality filter will not be free. No filter will be perfect (always some False Positive or False Negative). And then deal with the False Positive (customers who can't get to you because their email was blocked) or False Negative (the delete key is your friend).

    • Make it hard to use

    That can be making the email address graphical - customers hate that because they have to type it and there is room for error unless the address is really simply like [email protected].

    That can be using Javascript to assemble the email address on-the-fly so that web scrapers don't get it. But that doesn't work if customers have Javascript turned off.

    That can be using a Form instead of just a mailto: link. Keep the form simple - name, email address, phone number (if that is relevant for your business), a textarea field for the question/comment/complaint/etc. But often Forms need protection against spam.

    Make the Form hard to use. Seriously. That is what Captcha text input, multiple Submit steps, "I am not a Robot" checkboxes (which are useless unless paired with a system that analyzes input based on timing to (try to) filter out robots), etc. are all about. No one-size fits all.

    Personally, I just put the email address out there and use a quality spam filter. I would use a different email address for each page (if you have more than one), in order to make filtering through messages easier.

    Good luck. This is a never-ending problem.