Passing Variables Into mail()????
| From: | Chase | Date: | Wed, 25 Feb 2004 05:26:14 +0000 |
| Subject: | Passing Variables Into mail()???? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178812@lists.php.net to get a copy of this message | ||
I am trying to create a page that will display the results of a form as they
are being added into a database as well as forward that info via email to
multiple recipients. I sucked code from the .CHM file available at PHP/NET,
and it is working with one small issue... None of the variables that are
displayed on the result page or injected into the database are showing in
the email that I receive from the form.
Any help would be awesome... Mail code follows:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/* recipients */
$to = first@email.com . ", " ;
$to .= second@email.com;
/* subject */
$subject = "***V5 ERROR REPORT***";
/* message */
$message = '
<html>
<body>
<p>The following information was added to the v5 tracking record:</p>
<p><strong>Submit Date: <? echo $submit_date; ?></strong><br>
<strong>IP Address: <? echo $ip_address; ?><br>
Dealer Number: <? echo $dealer_number; ?><br>
Employee Name: <? echo $tester_name; ?><br>
Module / Screen Name: <? echo $module_name; ?><br>
Report:<br>
<? echo $report; ?>
</strong></p>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: V5 ERROR REPORT <v5@micfiles.com>\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);