trying to create html code within the body of a mail message
Posted: Tue Nov 04, 2008 11:12 am
I'm working on a routine that emails a message and the message has to have html in it. I want to include an html link that also includes a variable in it. Below is what I have, but it isn't working. I know it's probably a matter of the single and/or double quote placement.
The html link should end up being: http://www.domain.org/reference_tool-php/form.php?k=424 (the number at the end being the $LinkID variable--I included a random number here). My code is showing the proper text on the screen in the email as received, but the actual hyperlink is not picking up the variable at the end. How can this be corrected to work properly?
Here's how I'm setting the body string:
$body = 'Here is your link: <a href=""http://www.domain.org/reference_tool-ph ... D.'</a></p>';
The email message is being sent with the following code ($to and $subject are defined elsewhere):
mail($to,$subject,$body,
"To: $RefFull\n" .
"From: $from\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
Thanks in advance for your help.
Jerry
The html link should end up being: http://www.domain.org/reference_tool-php/form.php?k=424 (the number at the end being the $LinkID variable--I included a random number here). My code is showing the proper text on the screen in the email as received, but the actual hyperlink is not picking up the variable at the end. How can this be corrected to work properly?
Here's how I'm setting the body string:
$body = 'Here is your link: <a href=""http://www.domain.org/reference_tool-ph ... D.'</a></p>';
The email message is being sent with the following code ($to and $subject are defined elsewhere):
mail($to,$subject,$body,
"To: $RefFull\n" .
"From: $from\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
Thanks in advance for your help.
Jerry