• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Generate Dynamic Email Havesting Blocking Code

LEGEND ,
Sep 27, 2006 Sep 27, 2006

Copy link to clipboard

Copied

Is there any way out there to encode email addresses dynamically to prevent
email harvesting?

My employer would like to to populate a list of employees with their email
addresses dynamically and encrypt them so they cannot be harvested.

Any ideas how?


TOPICS
Advanced techniques

Views

507

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2006 Sep 27, 2006

Copy link to clipboard

Copied

Use this

<cfscript>
/**
* When given an email address this function will return the address in a format safe from email harvesters.
* Minor edit by Rob Brooks-Bilson (rbils@amkor.com)
* Update now converts all characters in the email address to unicode, not just the @ symbol. (by author)
*
* @param EmailAddress Email address you want to make safe. (Required)
* @param Mailto Boolean (Yes/No). Indicates whether to return formatted email address as a mailto link. Default is No. (Optional)
* @return Returns a string
* @author Seth Duffey (sduffey@ci.davis.ca.us)
* @version 2, May 2, 2002
*/
function EmailAntiSpam(EmailAddress) {
var i = 1;
var antiSpam = "";
for (i=1; i LTE len(EmailAddress); i=i+1) {
antiSpam = antiSpam & "&##" & asc(mid(EmailAddress,i,1)) & ";";
}
if ((ArrayLen(Arguments) eq 2) AND (Arguments[2] is "Yes")) return "<a href=" & "mailto:" & antiSpam & ">" & antiSpam & "</a>";
else return antiSpam;
}
</cfscript>


<CFOUTPUT>
#EmailAntiSpam("sduffey@ci.davis.ca.us")#<BR>
#EmailAntiSpam("sduffey@ci.davis.ca.us", "Yes")#<BR>
</CFOUTPUT>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 27, 2006 Sep 27, 2006

Copy link to clipboard

Copied

Use this

<cfscript>
/**
* When given an email address this function will return the address in a format safe from email harvesters.
* Minor edit by Rob Brooks-Bilson (rbils@amkor.com)
* Update now converts all characters in the email address to unicode, not just the @ symbol. (by author)
*
* @param EmailAddress Email address you want to make safe. (Required)
* @param Mailto Boolean (Yes/No). Indicates whether to return formatted email address as a mailto link. Default is No. (Optional)
* @return Returns a string
* @author Seth Duffey (sduffey@ci.davis.ca.us)
* @version 2, May 2, 2002
*/
function EmailAntiSpam(EmailAddress) {
var i = 1;
var antiSpam = "";
for (i=1; i LTE len(EmailAddress); i=i+1) {
antiSpam = antiSpam & "&##" & asc(mid(EmailAddress,i,1)) & ";";
}
if ((ArrayLen(Arguments) eq 2) AND (Arguments[2] is "Yes")) return "<a href=" & "mailto:" & antiSpam & ">" & antiSpam & "</a>";
else return antiSpam;
}
</cfscript>


<CFOUTPUT>
#EmailAntiSpam("sduffey@ci.davis.ca.us")#<BR>
#EmailAntiSpam("sduffey@ci.davis.ca.us", "Yes")#<BR>
</CFOUTPUT>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 27, 2006 Sep 27, 2006

Copy link to clipboard

Copied

That is sharp, but I need to display the persons name and link it to the
email address.
The same as this:
<a href="mailto:me@me.com">me< /a>
Can that be done with this?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 28, 2006 Sep 28, 2006

Copy link to clipboard

Copied

Of course it can. Just do this. <cfoutput><a href="mailto:#EmailAntiSpam("me@me.com")#">me< /a></cfoutput>

The script needs to be at the top of the document or above the cfoutput block.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 28, 2006 Sep 28, 2006

Copy link to clipboard

Copied

LATEST
Thanks a ton. Worked like a charm!


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation