Solved

HTML email; How to embed link inside sent email?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordpress url rewriting plugin 5 42
uploading image to a profile page 7 33
form button worked now it doesnt anymore 9 36
converting numbers with php 3 26
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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 dynamically set the form action using jQuery.
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 …

939 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

10 Experts available now in Live!

Get 1:1 Help Now