Sending HTML Email from PHP Form
Posted: Wed Jun 24, 2009 12:38 am
Hey guys, I'm new to PHP so if this is a newbie question I appologise..
The Form Handler I have created currently only sends the "confirmation email" as plain text.. How do I get it to send a HTML email?
I know I have to add 'PHP Headers' and have researched dozens of examples but just can't get it to work!!? (and this is now doing my head in)
I'll post the code below (hopefully correctly according to the board rules haha).. any help would be great appreciated, thankyou.
... blah blah... and the form/screen output goes on from there.
The Form Handler I have created currently only sends the "confirmation email" as plain text.. How do I get it to send a HTML email?
I know I have to add 'PHP Headers' and have researched dozens of examples but just can't get it to work!!? (and this is now doing my head in)
I'll post the code below (hopefully correctly according to the board rules haha).. any help would be great appreciated, thankyou.
Code: Select all
<?php
$rw_First_Name = $_POST['rw_First_Name'];
$rw_Last_Name = $_POST['rw_Last_Name'];
$rd_Contact_Number = $_POST['rd_Contact_Number'];
$re_Email_Address = $_POST['re_Email_Address'];
$r_Registration_Number = $_POST['r_Registration_Number'];
$r_Make_Model = $_POST['r_Make_Model'];
$r_Colour = $_POST['r_Colour'];
$date1x = $_POST['date1x'];
$r_Dropoff_Time = $_POST['r_Dropoff_Time'];
$date2x = $_POST['date2x'];
$r_Pickup_Time = $_POST['r_Pickup_Time'];
$r_Parking_Type = $_POST['r_Parking_Type'];
$rd___People_Travelling = $_POST['rd___People_Travelling'];
$r_Departure_Terminal = $_POST['r_Departure_Terminal'];
$r_Payment = $_POST['r_Payment'];
$r_Outside_Wash = $_POST['r_Outside_Wash'];
$r_Interior_Clean = $_POST['r_Interior_Clean'];
$r_Buff___n_Polish = $_POST['r_Buff___n_Polish'];
$r_Car_Cleaning_Package = $_POST['r_Car_Cleaning_Package'];
$Servicing_Description = $_POST['Servicing_Description'];
$Panel_Description = $_POST['Panel_Description'];
$Other_Details = $_POST['Other_Details'];
$rw_Services_SubTotal = $_POST['rw_Services_SubTotal'];
$TOTAL = $_POST['TOTAL'];
$formsent = mail('info@parkingport.com.au',
'Parking Port Booking',
"Customer Name: $rw_First_Name $rw_Last_Name\r\n
Contact Number: $rd_Contact_Number\r\n
Email Address: $re_Email_Address\r\n
Car Registration: $r_Registration_Number\r\n
Make / Model: $r_Make_Model\r\n
Colour: $r_Colour\r\n
Drop Off Date and Time: $date1x $r_Dropoff_Time\r\n
Pick Up Date and Time: $date2x $r_Pickup_Time\r\n
Parking Type: $r_Parking_Type\r\n
# of People Travelling: $rd___People_Travelling\r\n
Departure Terminal: $r_Departure_Terminal\r\n
Car Cleaning: $r_Outside_Wash\r\n
Car Cleaning: $r_Interior_Clean\r\n
Car Cleaning: $r_Buff___n_Polish\r\n
Car Cleaning Package: $r_Car_Cleaning_Package\r\n
Servicing Details: $Servicing_Description\r\n
Panel Beating Details: $Panel_Description\r\n
Other Details: $Other_Details\r\n
Cleaning Cost: $rw_Services_SubTotal\r\n
Parking Cost: $TOTAL\r\n
",
"From: $re_Email_Address\r\nBounce-to: info@parkingport.com.au");
if ($formsent) {
?>