I have just published my new web site (www.duepadroni.it). On the index pages for all four languages I have used the contact form which in itself works fine. I receive the messages in my IN-box. The only problem I have is that the form also contains a date range, and this date range is not displayed in the email that I receive. Below is the HTML code for the form that I have used.
Naam *
Email *
Telefoon
Onderwerp *
Betreft
-- Maak uw keuze --
Algemeen
Appartement Loggione
Appartement Cantinetta
periode
van
tot
Bericht *
Verstuur bericht
I have also made some changes to the seandmail.php file as instructed in the manual:
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
if( $_POST['template-contactform-email'] != '' ) {
$name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : '';
$email = isset( $_POST['template-contactform-email'] ) ? $_POST['template-contactform-email'] : '';
$phone = isset( $_POST['template-contactform-phone'] ) ? $_POST['template-contactform-phone'] : '';
$service = isset( $_POST['template-contactform-service'] ) ? $_POST['template-contactform-service'] : '';
$van = isset( $_POST['template-contactform-van'] ) ? $_POST['template-contactform-van'] : '';
$tot = isset( $_POST['template-contactform-tot'] ) ? $_POST['template-contactform-tot'] : '';
$daterange = isset( $_POST['template-contactform-daterange'] ) ? $_POST['template-contactform-name'] : '';
$subject = isset( $_POST['template-contactform-subject'] ) ? $_POST['template-contactform-subject'] : '';
$message = isset( $_POST['template-contactform-message'] ) ? $_POST['template-contactform-message'] : '';
$subject = isset($subject) ? $subject : 'New Message From Contact Form';
$botcheck = $_POST['template-contactform-botcheck'];
if( $botcheck == '' ) {
$mail->SetFrom( $email , $name );
$mail->AddReplyTo( $email , $name );
foreach( $toemails as $toemail ) {
$mail->AddAddress( $toemail['email'] , $toemail['name'] );
}
$mail->Subject = $subject;
$name = isset($name) ? "Name: $name
" : '';
$email = isset($email) ? "Email: $email
" : '';
$phone = isset($phone) ? "Phone: $phone
" : '';
$service = isset($service) ? "Service: $service
" : '';
$van = isset($name) ? "van: $van
" : '';
$tot = isset($name) ? "tot: $tot
" : '';
$daterange = isset($newfield) ? "Date Range: $daterange
" : '';
$message = isset($message) ? "Message: $message
" : '';
$referrer = $_SERVER['HTTP_REFERER'] ? '
This Form was submitted from: ' . $_SERVER['HTTP_REFERER'] : '';
$body = "$name $email $phone $service $van $tot $daterange $message $referrer";
The result what I see in my mail is:
Name: nico boots
Email: boots@planet.nl
Phone: 09876543123
Service: Loggione
van:
tot:
Message: testen
As you can see dates are not displayed. Can you tell me how to solve this?
This Form was submitted from: http://www.duepadroni.it/indexIT.php
