petenaylor Posted August 15, 2010 Share Posted August 15, 2010 Hi all I have a script that creates an email message, but I want to add a link to it to take the user to PayPal. Here's my code: $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=utf-8\n"; $headers .= "From: '".$_SERVER['HTTP_HOST']." Booking System' <info@".$_SERVER['HTTP_HOST']."> \n"; $subject = "Booking Confirmed!"; $message = "Dear ".$name.",<br /> <br /> This is confirmation of your booking. <br />"; $message .= "<table cellspacing=0 cellpadding=4 border=0>"; $message .= "<tr><td>Date</td><td>Time From</td><td>Time To</td></tr>"; $message .= $tempVar; $message .= "</table>"; $message .="<br />Reservation Status: Confirmed<br/>"; $message .="<br /><br />Kind Regards, <br /> ".$_SERVER['HTTP_HOST']." Team"; mail($email,$subject,$message,$headers); Can anyone help me add a line to the above to add the link in? Many thanks Pete Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 15, 2010 Share Posted August 15, 2010 If you know HTML this should take you no longer than 2 seconds to throw a link in. $message .= '<a href="link here">Link Text Here</a>'; Modify that line to your needs and place it where you want the url to be Quote Link to comment Share on other sites More sharing options...
petenaylor Posted August 15, 2010 Author Share Posted August 15, 2010 Hi there Thanks for the quick reply, I have added that line in but the link doesn't appear in the email. Just the text? Could this be an issue with my email browser? Thanks Quote Link to comment Share on other sites More sharing options...
DWilliams Posted August 15, 2010 Share Posted August 15, 2010 Not all email clients support HTML emails. Most modern ones do, though. I'm not 100% sure but I think a special property has to be set to flag the email as containing HTML otherwise it won't be parsed. I'm not sure how to do it off the top of my head, though Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.