Page 1 of 1

Adding Hyperlink In Autoresponder

Posted: Mon Mar 23, 2009 3:33 pm
by zachbrowne
Can someone please tell me how I would add a hyperlink in the following script?

Where is says - $message2 = "Thank you for taking the time to visit our site and request a catalog. Download the catalog here.\r\n\r\n".

I would like 'here' to be a hyperlink. Thanks!


<?php //catalog.php
$sp_email = "info@xxxxxxxxxx.com";
$subject = "Online Catalog Request Form";
//////////////////////////////////////////////////////////////////////////
////email to xxxxxxxxx
$to = $sp_email;
$header = "From: ".$_POST['email']."\r\n";
$message = "Name: ".$_POST['name']."\r\n".
"Phone: ".$_POST['phone']."\r\n".
"Email: ".$_POST['email']."\r\n";

mail($to,$subject,$message,$header);
/////////////////////////////////////////////////////////////////////////
////email to user
$to = $_POST['email'];
$header = "From: ".$sp_email."\r\n";
$message2 = "Thank you for taking the time to visit our site and request a catalog. Download the catalog here.\r\n\r\n".
"We received the following information:\r\n\r\n";
$message2 .= $message;
mail($to,$subject,$message2,$header);
////////////////////////////////////////////////////////////////////////
/// redirect to thank you page
header( "Location: /home/thank-you.html");
exit;
?>

Re: Adding Hyperlink In Autoresponder

Posted: Mon Mar 23, 2009 3:51 pm
by NOmeR1
You have to add some headers in $header to mark your message as html code

Code: Select all

$header  = "From: ".$_POST['email']."\r\n";
$header .= "Content-Type: text/html\r\n";
And then you can write html code in your message
*and don't forget to change all your new lines (\r\n\r\n...) to html new lines "<br/>"