Solved

HTML email; How to embed link inside sent email?

Posted on 2014-07-30
3
200 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

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.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

622 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