Solved

HTML email; How to embed link inside sent email?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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 …

756 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