Solved

Obfuscate mailto: email  address with CF?

Posted on 2006-11-09
7
1,179 Views
Last Modified: 2013-12-24
I am creating a business directory, where each business has address, phone, web address and possibly email address, all stored in a mySQL database.

Is there any reliable way to hide or obfuscate the email address with ColdFusion, if I want to create a mailto: link for each business? In the past I have created a contact form with the business info passed in the url, but for this site I am considering a simple text link that says "email" as a mailto link.

Thing is, I dont want to give away the email addresses to spammers..
any suggestions?
0
Comment
Question by:MichaelEvangelista
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:danrosenthal
ID: 17909893
Any mailto: link would give the user the email address. You may be able to hide in javascript, but it would still be attainable because it would be emailed fromt the client. The only way to hide the email address would be from a form that never displays the email address and emails on the server side after the user submits the form.
0
 

Author Comment

by:MichaelEvangelista
ID: 17909999
>> The only way to hide the email address would be from a form that never displays the email address and emails on the server side after the user submits the form.

Thats what I have done up till now.
I suppose my thought on this thread was whether I could dynamically generate the javascript to scramble the address in the actual page code. ( I realize it would be visible in the email client when the mailto link is clicked )

I have used js pages that let me enter an email address, and then the page generates the scrambled code, which I paste into the page, in place of the standard mailto: link.

Can I do this on the fly with CF somehow?
0
 
LVL 15

Expert Comment

by:danrosenthal
ID: 17910143
You could dynamically create it and just break it into 5 pieces for instance:

part1 = "something"
part2 = "msn"
part3 = "com"

and then build out the link in a JS function

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 15

Expert Comment

by:danrosenthal
ID: 17910145
(5 pieces with the "@" and ".")
0
 

Author Comment

by:MichaelEvangelista
ID: 17910179
Aha... yes this is what I was getting at.
Can you provide a sample of the JS?
I will gladly double the points on this thread.
0
 
LVL 15

Accepted Solution

by:
danrosenthal earned 500 total points
ID: 17910304
How about this?

<!--- CREATE a query to use --->
<CFSET myQuery = QueryNew("company, email")>
<CFSET newRow  = QueryAddRow(MyQuery, 1)>
<CFSET temp = QuerySetCell(myQuery, "company", "Microsoft", 1)>
<CFSET temp = QuerySetCell(myQuery, "email", "bill@microsoft.com", 1)>

<!--- REPLACE myquery.email with the email address you are using --->
<CFSET part1 = LISTFIRST(myquery.email,"@")>
<CFSET part3 = LISTLAST(myquery.email,".")>
<CFSET part2 = REREPLACE(LISTLAST(myquery.email,"@"),part3,"")>

<CFOUTPUT>
<SCRIPT language="JavaScript">
function sendit(){
      part1 = '#part1#';
      part2 = '#part2#';
      part3 = '#part3#';
      email = part1 + "@" + part2 + part3;
      linkto = "mai"+"lto:" + email;
      window.location = linkto;
}
</script>

<A href="javascript:void(0);" onclick="sendit();">Send email!</a>
</cfoutput>
0
 

Author Comment

by:MichaelEvangelista
ID: 17911249
Looks great - thanks Dan!
Haven't tested it yet but looking at the code, I bet it is just the thing.
( and  a reminder for me to brush up on listFirst / listLast )

Points increased and awarded!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question