Solved

How do I create a hyperlink that works on all email systems?

Posted on 2014-10-19
7
128 Views
Last Modified: 2014-10-22
I am developing a web site using PHP and mySQL and at one point I need to send the user a link to reset their password.

In my design, the e-mail is sent using HTML and the link is programmed using the obvious <a href="http://... &c tag.

This works fine on most systems; however, users with iPad and iPhone report that nothing happens when they click the link, although other links that others send them are working.

When I ask to see the links that are working it appears that they are written in plain text and that the link is actually being generated on the fly by Apple's e-mail reader.   However this approach will presumably not work on all systems.

Is there a recommended method of sending a link in an e-mail that will work on all systems (unless of course the user has turned links off, in which case nothing will work).

Thanks in advance for any advice.
0
Comment
Question by:DavidRMason
7 Comments
 
LVL 18

Expert Comment

by:Peter Hutchison
ID: 40389738
The correct html tag is to use mailto:, not http:
<a href="mailto:email.address.here">Link to email address</a>
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40389747
@Peter: on reset password links, they are links, not mailtos.

@David: all email clients I know will automatically create links from plain text.
0
 
LVL 18

Expert Comment

by:Peter Hutchison
ID: 40389978
Do you have a sample of the link (not the exact one) but approx syntax?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:DavidRMason
ID: 40390038
Peter - the body of the e-mail is created in PHP as follows:

$body='<html><body>'.
                'You have requested a password reset for the xxx web site.  '.
                'Please click the link below to set your password<br><br>'.
                '<a href="http://'.$host.'index.php?action='.$actionCode.'">Reset password</a>'.
                '</body></html>';
where the variable $host contains the web site name beginning www.... and the variable $actionCode contains a randomly generated string that is stored in MYSQL and will time-expire if not clicked promptly, and is linked to the user's e-mail address (which they have to re-enter after clicking the link to validate it).

This works fine except with 2 test members both using Apple devices (iPad and iPhone) who report that nothing happens when the click the link, although other links from other people work for them.

Sending in plain text and having the link created automatically in the user's mail system is a less elegant option as it means the full http://&c is exposed to the user, whereas all they need is a link whose text says "Reset password" that they can click.

As a backup I'm including an option to copy and paste the URL.

Thanks for your help.

David
0
 
LVL 18

Accepted Solution

by:
Peter Hutchison earned 500 total points
ID: 40390935
I think the html is incomplete and the Macs are being security conscience. So I would add a proper head section, a title
and possible a DOCTYPE line at the top to make it a valid html document.
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 40394863
I've seen a lot of "reset" emails say something like:

<a href="http://www.abc.com">Click Here to reset your password</a>. if this link doesn't work, please copy and paste the link below directly into your browsers address bar.

Reset Link - http://www.abc.com

this is a common and accepted practice, as it's always difficult to make ALL browsers happy these days :)
0
 

Author Closing Comment

by:DavidRMason
ID: 40396603
Peter - thanks for your help - putting a proper header in the html solved the problem.

I simply replaced the <html> tag above with

<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
 </head>

and it now works.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…

757 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

21 Experts available now in Live!

Get 1:1 Help Now