PHP and MIME
Posted: Mon Aug 10, 2009 4:39 pm
Hey all,
I'm trying to put an html tag (namely <a href>) into an email that is being generated with the mail function. As I understand it, I will have to use MIME to do this, as the mail function only outputs plaintext. I would like to have the word "here" in the message link to another php page that displays my database. What is exactly the best way to go about this? Thanks for the help.
Note: $to and $subject are defined above the code that I'm quoting.
I'm trying to put an html tag (namely <a href>) into an email that is being generated with the mail function. As I understand it, I will have to use MIME to do this, as the mail function only outputs plaintext. I would like to have the word "here" in the message link to another php page that displays my database. What is exactly the best way to go about this? Thanks for the help.
Note: $to and $subject are defined above the code that I'm quoting.
Code: Select all
$message = "A new allocation request has been filled out. You can review the request here.";
$headers .= 'MIME-Version: 1.0' . "\r\n";
if(mail($to, $subject, $message, $headers))
{
echo "Mail sent successfully." ;
}
else
{
echo "An error occurred, and your mail was not sent. Please try again later.";
}