Jump to content

anchor embedded in php mail message


andibakker

Recommended Posts

I have got a $message variable that contains an anchor. If I echo the message, it displays the anchor correctly, but if I send the mail, it displays incorrectly.  Below is my code:

 

$message = "Dear $username, \n\n blah blah blah ." . 
					'<a href="http://localhost:81/unsubscribe.php?id=' . $loginid . '">Unsubscribe Here</a>';
echo "$message";

$headers = 'From: [email protected]';							 						                       
$subject = "Reminder";
$toaddress = $email;

//send the email
mail($toaddress, $subject, $message, $headers);

 

This displays from the echo correctly

 

BUT the email that is sent looks like this :

 

Dear Andi,

 

blah blah blah .<a href="http://localhost:81/unsubscribe.php?id=1">Unsubscribe Here</a>

 

 

How must I embed this in the $message ?

 

Thanks

Andi

 

 

Link to comment
https://forums.phpfreaks.com/topic/180860-anchor-embedded-in-php-mail-message/
Share on other sites

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.