Solved

Adding an active URL Link within Text Editor

Posted on 2014-03-11
11
564 Views
Last Modified: 2014-03-13
Hello,

A developer has created a PHP site which sends an automatically generated email to a nominated user. This email contains a link. I notice that in Gmail this link is active and clickable - however in Yahoo mail, this link is inactive and is just text (confirmed by other users).

Below is the code used:

{P}To login and complete your assessment, please click on this link {A}http://www.mysite.com/here{AEND} and then enter your password {TOKENID}.{PEND}

Open in new window


Is there a way to edit this code to ensure the url shown is 'active' (clickable) when it hits all email providers?

Thanks
0
Comment
Question by:dabug80
[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
  • 5
  • 4
  • 2
11 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39922710
Try to see if regular HTML code works:
<p>To login and complete your assessment, please click on this link <a href="http://www.mysite.com/here">http://www.mysite.com/here</a> and then enter your password {TOKENID}.</p>

Open in new window


If not, we're going to need the code, cause something should replace {A} and {AEND} with html code and apparently it's not doing so.

HTH,
Dan
0
 
LVL 1

Author Comment

by:dabug80
ID: 39923141
Thanks for the suggestion, but it didn't work. I found this discussion on links not working in Yahoo mail. Perhaps it's a Yahoo thing.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39923158
Gmail and most email clients will take anything that resembles an URL and transform it into a clickable link.
Yahoo decided not to.

Try to see the source of the message as it was received (in gmail, yahoo, does not matter) and see if the URL has standard <a> tags surrounding it.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Author Comment

by:dabug80
ID: 39923165
I've viewed the Yahoo page source and it's showing:

<\/p>\\n\\nTo login and complete your assessment, please click on this link http:\/\/www.mysite.com\/here and then enter your password

Open in new window


So it doesn't look like Yahoo likes to code links
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39923173
It's not Yahoo's job to code links, it's yours. Just because gmail helps you when you forget, does not mean Yahoo is forced to do the same.

You need to send standard html code, so review the generator (that at the moment only escapes "/", not adding the <a></a> tags).
0
 
LVL 1

Author Comment

by:dabug80
ID: 39923190
I tried emailing with just the content:

<a>mysite.com</a>

And the link still didn't activate.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39923194
Of course. That's not valid code. Try this:
<a href="mysite.com">mysite.com</a>
0
 
LVL 1

Author Comment

by:dabug80
ID: 39923232
Ok. I tried

<a href="http://www.mysite.com">mysite.com</a>
and
<a href="mysite.com">mysite.com</a>

Neither worked (that was the only content I had in the email). It just returned text in Yahoo.
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39923357
How did you send the email? From an email client? If so, you have to use the "Insert hyperlink" feature.
Here's what Thunderbird sent when I just pasted <a href="http://www.mysite.com">mysite.com</a> in the message body:
 &lt;a href=3D<a class=3D"moz-txt-link-rfc2396E" href=3D"http://www.my=
site.com">"http://www.mysite.com"</a>&gt;mysite.com&lt;/a&gt;

Open in new window


And here's the result when using "Insert hyperlink":
<a href=3D"http://www.mysite.com">mysite.com</a>

Open in new window

0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39923508
There are several layers of things going on here.  Let me tell you what I have experienced with things like this.

1. There is no accountability in email.  Every part of the headers and the message can be bogus.  You have no control over what the client email reader does with your message.   You cannot control the rendering of your message, nor know whether it has been read with more than a very little certainty.

2. There are many, many email reader programs.  They work differently.  They render identical data differently.  Some of them will render anything that looks like a link in the form of a link.

3. Some people perceive that hyperlinks in email represent a security exposure.  It might make sense that Yahoo would look down upon links because anybody still using Yahoo email probably started many years ago and may be an older and unsophisticated user, the gullible kind that would click the "get rich quick" link and get taken to an attack site.  (Don't laugh - I have clients who believe everything on the internet)

4. There are basically two types of email messages - plain text and HTML.  If you want to send plain text it's pretty easy - you just send a text string in the body of the message.  If you want to send HTML (which may give you a better chance of getting your links to be clickable) you can follow the guidelines here (Example #4):
http://php.net/manual/en/function.mail.php

5. If you want to simplify your life, consider using a service like ConstantContact.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39927851
Thanks for the points.  Looking over some of the broadcast email I receive I'm finding a frequent and sensible design that says, "Click here or copy / paste into your browser."  Seems like a good idea.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This video teaches users how to migrate an existing Wordpress website to a new domain.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

734 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