• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

ampersand in email address

We have a jobs database where the html is stored for posting various jobs.   One of the clients has an ampersand in the email address that have added to their listing.    So the link is mailto:e&i@company.com.   We have escaped it out to be mailto:e&i@company.com.    The html is outputted as such when you view the page but when you click on the link, it truncates the email address at the e and the rest of it is looked at like it is a regular & in the URL.      The page is generated using ColdFusion8 but it is just a straight cfoutput.   Any ideas on what else to do?  
0
digitalwise
Asked:
digitalwise
  • 2
  • 2
  • 2
  • +1
1 Solution
 
Andrew DerseIT ManagerCommented:
URL's treat the & as &   amp;  The & is used to string variables together like:

index.php?count=3&id=4&temp=no etc...

I'm not sure how you are going to actually accomplish this...as that's how browsers render the URLs...
0
 
CyanBlueCommented:
You could try \&, or %26 as well.

CyanBlue
0
 
Andrew DerseIT ManagerCommented:
Nice...I completely forgot about the escape and the short-hand form for the &....nice
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
_agx_Commented:
Don't know if it works for mailto: links, but have you tried URLEncodedFormat() ?
0
 
digitalwiseAuthor Commented:
The %26 worked like a charm!   Thank you.   Forgot about that one.
0
 
CyanBlueCommented:
I don't know why it won't work when you said it is straight output. I could be totally wrong though.
Can you test and let us know?

CyanBlue
0
 
_agx_Commented:
(That comment was from me, not digitalwise)

Out of curiosity, I just tried it and it seems to work in Outlook .. But thinking about it, I don't know that one would want to encode the whole thing. Just the "&".  So the "%26" might be better. Anyway, here's the results of URLEncodedFormat for the curious :)

Result:
<a href="mailto:e%26i%40company%2Ecom">MailTo Test</a>

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now