Solved

Obfuscate mailto: email  address with CF?

Posted on 2006-11-09
7
1,153 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
  • 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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now