Solved

Obfuscate mailto: email  address with CF?

Posted on 2006-11-09
7
1,170 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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