Hi, I'm writing a really simple "tell a friend" script for a client. I'm having the stupidest problem, and I know the answer is something simple, but I've tried searching with not results that help, and I'm not at home so I don't have access to any of my books.
Basically, the script allows a person to enter their name and email, and their friend's name and email. Than it sends a customized message to the friend, from the person's email address.
Now, I want to format the message, using tables to put in my client's email template, with a header image, side col, etc. But when I insert the HTML into the email's body variable it doesn't process. It just prints the straight HTML. I know I've read about how to do this, but I can't remember how, or what to even search for.
Here's my basic code without the validation stuff.
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$friend = $_POST['friend'];
$friendemail=$_POST['friendemail'];
$message = $_POST['message'];
$url = $_POST['url'];
$body = "Hello $friend ($friendemail),
Your friend $name ($email) wants to share the following with you:
$message
Hope to see you around!
OUR SITE NAME ($url) Team";
$subject = "From $name -- Thought you would like this!";
$headers .= "To: $friend <$friendemail>" . "\r\n";
$headers .= "From: $name <$email>" . "\r\n";
mail($friendemail, $subject, $body, $headers);
?>
Basically, I want to wrap everything in $body in HTML formatting.
Thanks in advance,
Lindsey