Solved

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

Posted on 2014-10-19
7
155 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
[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
7 Comments
 
LVL 19

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 35

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 19

Expert Comment

by:Peter Hutchison
ID: 40389978
Do you have a sample of the link (not the exact one) but approx syntax?
0
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 

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 19

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 33

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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