Solved

HTML email; How to embed link inside sent email?

Posted on 2014-07-30
3
199 Views
Last Modified: 2014-07-30
My HTML email is arriving to its destination successfully, however the link is not click-able. It just says - This page. If I remove the <a> tags the link is click-able but shows the address and technical looking $number. What am I missing here? Thanks.

$body  = "<html>";
$body .= "<body>";
$body .= "<a http://www.mysite.com/page/" . $number. ">This page</a>";
$body .= "</body>";
$body .= "</html>";

$headers['MIME-Version'] = "1.0";
$headers['Content-type'] = "text/html;charset=UTF-8";
0
Comment
Question by:kadin
[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
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 400 total points
ID: 40230465
Spot the difference

$body .= "<a href='http://www.mysite.com/page/" . $number. "'>This page</a>";

Open in new window

0
 
LVL 14

Assisted Solution

by:Renante Entera
Renante Entera earned 100 total points
ID: 40230476
Gary is right and you can actually simply do it like this:

$body .= "<a href='http://www.mysite.com/page/$number'>This page</a>";

Open in new window


Since you are using double quotes when setting a variable then those simple variables will automatically be parsed by PHP and there is no need for you to add extra (dots) to avoid confusions.

Hope this helps a lot...
0
 

Author Closing Comment

by:kadin
ID: 40230495
Thank you both.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
if statement malfunction 5 44
how to use jquery variable in mysql query 20 77
Form not executing correctly 1 28
Why is my select returning NaN 23 46
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

710 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