I'm using this code... <?php $message = "This is the message"; mail($send_to, $subject, '<html> <body> <p> echo $message; </p> </body> </html>', "From: The Sender <name@domain.com>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); ?> PHP: But how can I make it work? I'm trying to send HTML emails - but I want to use information from a form to build the body of the message. However, because I'm in the middle of the mail command, it won't let me call the variable? Any ideas?
Probably it should be like this: <?php $message = "This is the message"; mail($send_to, $subject, '<html><body><p>' . $message . '</p></body></html>', "From: The Sender <name@domain.com>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); ?> PHP:
Just for future reference. the reason the first code didn't work was due to the single quotes. had you used double quotes like " then it would have showed you the value.