CodeIgniter Forums
safe mailto - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: safe mailto (/thread-31184.html)

safe mailto - El Forum - 06-09-2010

I've just been looking at the safe_mailto function which outputs the address through javascript to hide it from spam bots.

If the user does not have javascript enabled no email address is displayed. So I've put the plain text version of the email after in a noscript tag like so

Email: &lt;?php echo safe_mailto('[email protected]', '[email protected]'); ?&gt;<noscript>'[email protected]'</noscript>

My question is, by doing this do will spam bots stil pick up on the email address or do they tend to just look for a <a href="mailto"> link?

I know you can never completley protect against spam, just wondering if it worth me bothering with this technique.


safe mailto - El Forum - 06-09-2010

I'm certainly no expert but having the email address in the <noscript> tags is just as bad. Spam bots will likely run a regex on the code to extract all email addresses, not just those in an anchor tag.

There are some methods such as obsfucation which will make the spam bots work harder.

safe mailto - El Forum - 06-10-2010

Thanks for the reply. I did think it wasn't going to help.

I think it might be best to just stick to the regular mailto and then have our spam filters sort out the incoming emails.


safe mailto - El Forum - 06-10-2010

[eluser]Rob Gordijn[/eluser]
why not checking if the visitor has javascript enabled?
If not, ask the visitor to enable it, problem solved :-)


safe mailto - El Forum - 06-10-2010

A nice idea but I work for an academic institue so we can't really add restrictions like that.