xenia
05-08-2006, 11:53 AM
Hello everyone,
I am using the mail function in order to send an email with the information taken from a form.
The function is working fine but when I tryied to format the body of the message using html code it just print this:
<html><head><title>Enquiry Form</title></head><body>
<table border='1'><tr><td>Enquiry Form</td></tr>
<tr><th>Pick up date</th>
<th>Pick up hour</th>
<th>Drop off date</th>
<th>Drop off hour</th>
<th>Car Type</th>
<th>Price</th>
<th>Prefix</th>
<th>Prefix</th>
</tr>
<tr><td>08/05/2006</td>
<td>19:00</td>
<td>11/05/2006</td>
<td>19:00</td>
<td>Fiat</td>
<td></td>
<td>Ms</td>
<td>Xenia</td>
</tr></table></body></html>
And here is the code:
$to = "xenia@test.com";
$subject = "My subject";
//$txt = "Pick up date: ". $pickupdate . $dropoffdate . $prefix;
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
$txt= "<html><head><title>Emver Enquiry Form</title></head><body>
<table border=\"1\"><tr><td>Emver Enquiry Form</td></tr>
<tr><th>Pick up date</th>
<th>Pick up hour</th>
<th>Drop off date</th>
<th>Drop off hour</th>
<th>Car Type</th>
<th>Price</th>
<th>Prefix</th>
<th>Prefix</th>
</tr>
<tr><td>". $pickupdate ."</td>
<td>". $pickuphour . "</td>
<td>". $dropoffdate . "</td>
<td>". $dropoffhour . "</td>
<td>". $model . "</td>
<td>". $price . "</td>
<td>". $prefix . "</td>
<td>". $firstname . "</td>
</tr></table></body></html>";
mail($to,$subject,$txt,$headers);
Can you please help me where is the error?
Thank you,
Xenia
I am using the mail function in order to send an email with the information taken from a form.
The function is working fine but when I tryied to format the body of the message using html code it just print this:
<html><head><title>Enquiry Form</title></head><body>
<table border='1'><tr><td>Enquiry Form</td></tr>
<tr><th>Pick up date</th>
<th>Pick up hour</th>
<th>Drop off date</th>
<th>Drop off hour</th>
<th>Car Type</th>
<th>Price</th>
<th>Prefix</th>
<th>Prefix</th>
</tr>
<tr><td>08/05/2006</td>
<td>19:00</td>
<td>11/05/2006</td>
<td>19:00</td>
<td>Fiat</td>
<td></td>
<td>Ms</td>
<td>Xenia</td>
</tr></table></body></html>
And here is the code:
$to = "xenia@test.com";
$subject = "My subject";
//$txt = "Pick up date: ". $pickupdate . $dropoffdate . $prefix;
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
$txt= "<html><head><title>Emver Enquiry Form</title></head><body>
<table border=\"1\"><tr><td>Emver Enquiry Form</td></tr>
<tr><th>Pick up date</th>
<th>Pick up hour</th>
<th>Drop off date</th>
<th>Drop off hour</th>
<th>Car Type</th>
<th>Price</th>
<th>Prefix</th>
<th>Prefix</th>
</tr>
<tr><td>". $pickupdate ."</td>
<td>". $pickuphour . "</td>
<td>". $dropoffdate . "</td>
<td>". $dropoffhour . "</td>
<td>". $model . "</td>
<td>". $price . "</td>
<td>". $prefix . "</td>
<td>". $firstname . "</td>
</tr></table></body></html>";
mail($to,$subject,$txt,$headers);
Can you please help me where is the error?
Thank you,
Xenia