Click here to Skip to main content
15,035,283 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear Actually I want to send a complete HTML Table in E-Mail getting data from HTML Form.

In Inbox data is appears as,

<html><body>it must be appear in table form what is the problem...

my code is,

<!-- ////////////////////// Starting of form is right here ///////////////////// -->

<form method="POST" action="#" role="form">



PLEASE FILL THE FORM BELOW TO SCHEDULE AIRPORT DROP OFF RESERVATION






<label class="heding-control">Pick Up Date</label>

<input class="frm-control" type="text" placeholder='Select Date' name="pickupdate"/>




<label class="heding-control">Pick Up Time</label>

<select class="frm-control" type="text" placeholder='Select Date' name="pickuph">
<option>Hours</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>00</option>
</select>


<label class="heding-control" style="color:white;">. </label>

<select class="frm-control" style="margin-right:0px;" type="text" placeholder='Select Date' name="pickupm">
<option>Mints</option>
<option>00</option>
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
</select>





<label class="heding-control">Passenger First Name</label>

<input class="frm-control" type="text" placeholder='Enter Name Here' name="pfname"/>



<label class="heding-control">Last Name</label>

<input class="frm-control" type="text" placeholder='Enter Last Name' name="plname"/>




<label class="heding-control">Home phone</label>

<input class="frm-control" type="text" placeholder='000-237-1793' name="homephone"/>



<label class="heding-control">Cell phone</label>

<input class="frm-control" type="text" placeholder='000-237-1793' name="cellphone"/>



<label class="heding-control">Passengers Count</label>

<select class="frm-control" type="text" placeholder='Select Date' name="members">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
</select>



<label class="heding-control">Vehicle Request</label>

<select class="frm-control" type="text" placeholder='Luxury Sedan' name="carname">
<option>Luxury Sedan</option>
<option>BMW</option>
<option>HONDA</option>
<option>SUZUKI</option>
</select>



<label class="heding-control">Email</label>

<input class="frm-control" type="text" placeholder='youremail@yahoo.com' name="email"/>



<label class="heding-control">Pickup Address, City</label>

<input class="frm-control" type="text" placeholder='Enter Address Here' name="pickupadd"/>



<label class="heding-control">Drop off Airport</label>

<select class="frm-control" type="text" placeholder='other Airport' name="dropoffairport">
<option>Select Airport</option>
<option>LONDON</option>
<option>PARIS</option>
<option>NEW YORK</option>
</select>



<label class="heding-control">Departure Time</label>

<select class="frm-control" type="text" placeholder='Select Date' name="deptimeh">
<option>Hours</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>00</option>
</select>


<label class="heding-control" style="color:white;">. </label>

<select class="frm-control" style="margin-right:0px;" type="text" placeholder='Select Date' name="deptimem">
<option>Mints</option>
<option>00</option>
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
</select>




<label class="heding-control">Payment Method</label>

<select class="frm-control" type="text" placeholder='select Here' name="pmethod">
<option>In Person Payment (Passenger Will Pay In Car)</option>
<option>PAY PAL</option>
<option>DEBIT CARD</option>
<option>CREDIT CARD</option>
</select>



<label class="heding-control">Credit Card Number</label>

<input class="frm-control" type="text" placeholder='Enter Number Here' name="creditcard"/>



<label class="heding-control">Expiration Date</label>

<select class="frm-control" type="text" placeholder='select Here' name="expdate">
<option>Select Date</option>
</select>



<label class="heding-control">Security Code</label>

<input class="frm-control" type="text" placeholder='Enter Code Here' name="passcode"/>



<label class="heding-control">Comments/Requests</label>

<textarea class="frm-control" style="height:100px;" type="text" placeholder='Enter your comment here' name="anycomment"></textarea>



PLEASE ONLY FILL THE FORM BELOW IF YOU WANT TO SCHEDULE A RETURN TRIP





<label class="heding-control">Return Pickup Date</label>

<select class="frm-control" type="text" placeholder='select Here' name="rpickupdate">
<option>Select Date</option>
</select>



<label class="heding-control">Pick Up Time</label>

<select class="frm-control" type="text" placeholder='Select Date' name="rpickuph">
<option>Hours</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>00</option>
</select>


<label class="heding-control" style="color:white;">.</label>

<select class="frm-control" style="margin-right:0px;" type="text" placeholder='Select Date' name="rpickupm">
<option>Mintus</option>
<option>00</option>
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
</select>



<label class="heding-control">Pick Up Airport </label>

<select class="frm-control" type="text" placeholder='select Here' name="rpickup_airport">
<option>Select Airport</option>
<option>LONDON</option>
<option>PARIS</option>
<option>NEW YORK</option>
</select>



<label class="heding-control">Arrival Time ETA</label>

<select class="frm-control" type="text" placeholder='Select Date' name="arrtime_etah">
<option>Hours</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>00</option>
</select>


<label class="heding-control" style="color:white;">. </label>

<select class="frm-control" style="margin-right:0px;" type="text" placeholder='Select Date' name="arrtime_etam">
<option>Mintus</option>
<option>00</option>
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
</select>



<label class="heding-control">Airline Name</label>

<select class="frm-control" type="text" placeholder='select Here' name="airline_name">
<option>Select Airline</option>
<option>PIA</option>
<option>MALAYSIAN</option>
<option>PAK</option>
</select>



<label class="heding-control">Flight Number #</label>

<input class="frm-control" type="text" placeholder='Type Here' name="flightno"/>



<label class="heding-control">Flight Departure City</label>

<input class="frm-control" type="text" placeholder='Type Here' name="fdepcity"/>



<label class="heding-control">Reserved By</label>

<input class="frm-control" type="text" placeholder='Type Here' name="resby"/>



<label class="heding-control">Drop Off Address</label>

<input class="frm-control" type="text" placeholder='Type Here' name="rdropoffadd"/>



<label class="heding-control">City, State</label>

<input class="frm-control" type="text" placeholder='Type Here' name="rcity"/>



<label class="heding-control">City, State</label>


<input class="control" type="radio" name="Check" checked />Inside Pickup (Meet Greet)


<input class="control" type="radio" name="Check" checked />Outside Pickup (Curbside)







<button class="RESERVATION-btn" type="submit" name="submit">MAKE RESERVATION</button>
<button class="cancel-btn">Cancel</button>


</form>

<!-- Ending of the form is right here -->






<!-- ///////////// Php coding starts right here ///////////// -->

echo $pickupdate = $_POST['pickupdate'];
echo '
';
echo $pickuph = $_POST['pickuph'];
echo '
';
echo $pickupm= $_POST['pickupm'];
echo '
';
echo $pfname = $_POST['pfname'];
echo '
';
echo $plname = $_POST['plname'];
echo '
';
echo $homephone = $_POST['homephone'];
echo '
';
echo $cellphone = $_POST['cellphone'];
echo '
';
echo $members = $_POST['members'];
echo '
';
echo $carname = $_POST['carname'];
echo '
';
echo $email = $_POST['email'];
echo '
';
echo $pickupadd = $_POST['pickupadd'];
echo '
';
echo $dropoffairport = $_POST['dropoffairport'];
echo '
';
echo $deptimeh = $_POST['deptimeh'];
echo '
';
echo $deptimem = $_POST['deptimem'];
echo '
';
echo $pmethod = $_POST['pmethod'];
echo '
';
echo $creditcard = $_POST['creditcard'];
echo '
';
echo $expdate = $_POST['expdate'];
echo '
';
echo $passcode = $_POST['passcode'];
echo '
';
echo $anycomment = $_POST['anycomment'];
echo '
';
echo $rpickupdate = $_POST['rpickupdate'];
echo '
';
echo $rpickuph = $_POST['rpickuph'];
echo '
';
echo $rpickupm = $_POST['rpickupm'];
echo '
';
echo $rpickup_airport = $_POST['rpickup_airport'];
echo '
';
echo $arrtime_etah = $_POST['arrtime_etah'];
echo '
';
echo $arrtime_etam = $_POST['arrtime_etam'];
echo '
';
echo $airline_name = $_POST['airline_name'];
echo '
';
echo $flightno = $_POST['flightno'];
echo '
';
echo $fdepcity = $_POST['fdepcity'];
echo '
';
echo $resby = $_POST['resby'];
echo '
';
echo $rdropoffadd = $_POST['rdropoffadd'];
echo '
';
echo $rcity = $_POST['rcity'];

echo '
';

echo "Everything is OK";

if(isset($_POST['submit']))
{
$message = '<html><body>
PLEASE FILL THE FORM BELOW TO SCHEDULE AIRPORT DROP OFF RESERVATION
PICK UP DATE: PICK UP TIME: FIRST NAME: LAST NAME:
2015-12-1201:00M ShafiqueQadri
HOME PHONE: CELL PHONE: PASSENGER COUNT: VEHICLE REQUEST:
030037888550312773423304HONDA
E-MAIL ID: PICK UP ADDRESS: DROP OFF AIRPORT: DEPARTURE TIME:
sqadri888@gmail.comLahore PakistanPARIS02:30
PAYMENT METHOD: CREDIT CARD#: EXPIRATION DATE: SECURITY CODE:
DEBIT CARD98098098Select Date89889
COMMENTS/REQUESTS:
PLEASE ONLY FILL THE FORM BELOW IF YOU WANT TO SCHEDULE A RETURN TRIP
PICK UP DATE: PICK UP TIME: PICK UP AIRPORT: ARRIVAL TIME ETA:
Select Date02:10PARIS02:10
AIRLINE NAME: FLIGHT NUMBER#:
';
$message .= '';
$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

$message .= '';

echo $message .= '';
$message .= '
PLEASE FILL THE FORM BELOW TO SCHEDULE AIRPORT DROP OFF RESERVATION
PICK UP DATE: PICK UP TIME: FIRST NAME: LAST NAME:
'.$pickupdate.''.$pickuph.':'.$pickupm.''.$pfname.''.$plname.'
HOME PHONE: CELL PHONE: PASSENGER COUNT: VEHICLE REQUEST:
'.$homephone.''.$cellphone.''.$members.''.$carname.'
E-MAIL ID: PICK UP ADDRESS: DROP OFF AIRPORT: DEPARTURE TIME:
'.$email.''.$pickupadd.''.$dropoffairport.''.$deptimeh.':'.$deptimem.'
PAYMENT METHOD: CREDIT CARD#: EXPIRATION DATE: SECURITY CODE:
'.$pmethod.''.$creditcard.''.$expdate.''.$passcode.'
COMMENTS/REQUESTS:
'.$anycomment.'
PLEASE ONLY FILL THE FORM BELOW IF YOU WANT TO SCHEDULE A RETURN TRIP
PICK UP DATE: PICK UP TIME: PICK UP AIRPORT: ARRIVAL TIME ETA:
'.$rpickupdate.''.$rpickuph.':'.$rpickupm.''.$rpickup_airport.''.$arrtime_etah.':'.$arrtime_etam.'
AIRLINE NAME: FLIGHT NUMBER#: FLIGHT DEPARTURE CITY: RESERVED BY:
'.$airline_name.''.$flightno.''.$fdepcity.''.$resby.'
DROP OFF ADDRESS: CITY, STATE: CITY, STATE:
'.$rdropoffadd.''.$rcity.''.$pfname.'
</body></html>';

$subject = "Taxi Reservation";
$sender = "mr.shafique.qadri@gmail.com";
$to = $_POST['email'];

mail($to, $subject, $message, $sender);

echo "<script>alert('E-Mail is being Sent.')</script>";
}

?>

<!-- PHP coding ends right here -->
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900