Jump to content

Add link into email message


petenaylor

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/210793-add-link-into-email-message/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.