Hallo zusammen,
ich bin dabei eine Internetseite zu bauen.
Das darin enthaltene Kontaktformular wird über eine mail.php versendet.
Sobald ich diese Mail jedoch empfange, zeigt mir diese keine deutschen Umlaute ä ü ö usw. an.
Ich habe schon in sämtlichen Foren und Seiten nach dem Fehler gesucht, allerdings komme ich nicht drauf, deshalb wende ich mich an euch.
Der Zeichensatz ist in meiner mail.php ganz unten bei $headers eingetragen, in der .html steht er ebenfalls ganz oben. Übersehe ich etwas?
Freue mich auf eure Hilfe!
ich bin dabei eine Internetseite zu bauen.
Das darin enthaltene Kontaktformular wird über eine mail.php versendet.
Sobald ich diese Mail jedoch empfange, zeigt mir diese keine deutschen Umlaute ä ü ö usw. an.
Ich habe schon in sämtlichen Foren und Seiten nach dem Fehler gesucht, allerdings komme ich nicht drauf, deshalb wende ich mich an euch.
Der Zeichensatz ist in meiner mail.php ganz unten bei $headers eingetragen, in der .html steht er ebenfalls ganz oben. Übersehe ich etwas?
Freue mich auf eure Hilfe!
PHP-Code:
<?php
if($_POST['formid']=='book_table')
{
$cust_name=$_POST['cust_name'];
$cust_phone=$_POST['cust_phone'];
$name='Admin';
$email='info@formidable-events.de';
$email_to_send_to=$_POST['cust_email'];
$email_subject="AWESOME SPICES - Table Booking Confirmation";
$person_no=$_POST['dine'];
$occasiontype=$_POST['occasiontype'];
$comments='Hello '.$cust_name;
$comments='<br><br><br>The following are your booking details:<br> ';
$comments.='<br> Name :'.$cust_name;
$comments.='<br> Phone no. :'.$cust_phone;
$comments.='<br> Occasion :'.$occasiontype;
$comments.='<br> No. of seats booked :'.$person_no;
}
if($_POST['formid']=='contact-us-form')
{
$name=$cust_name=$_POST['cust_name'];
$email=$_POST['cust_email'];
$email_to_send_to='info@formidable-events.de';
$email_subject="Contact";
$comments=$_POST['comments'];
}
if($_POST['formid']=='reserve-form')
{
$cust_name=$_POST['cust_name'];
$cust_phone=$_POST['cust_phone'];
$cust_firma=$_POST['cust_firma'];
$cust_gast=$_POST['cust_gast'];
$cust_budget=$_POST['cust_budget'];
$cust_nachricht=$_POST['cust_nachricht'];
$name=$_POST['cust_name'];
$email=$_POST['cust_email'];
$email_to_send_to='info@formidable-events.de';
$email_subject="formidable Online Anfrage";
$person_no=$_POST['dine'];
$drinks=$_POST['drink'];
$zusatz=$_POST['zusatz'];
$occasiontype=$_POST['occasiontype'];
$occasiontype2=$_POST['occasiontype2'];
$tp=$_POST['tp'];
$dp=$_POST['dp'];
$comments='Hello '.$cust_name;
$comments.='<br> You have booked the table for :'.$catering;
$comments='<br><br><br>Folgende Daten wurden übermittelt<br> ';
$comments.='<br> <b>Name: </b>'.$cust_name;
$comments.='<br> <b>Telefon: </b>'.$cust_phone;
$comments.='<br> <b>Firma: </b>'.$cust_firma;
$comments.='<br><br> <b>Anlass: </b>'.$occasiontype;
$comments.='<br> <b>Location: </b>'.$occasiontype2;
$comments.='<br> <b>Anzahl Gäste: </b>'.$cust_gast;
$comments.='<br> <b>Budget: </b>'.$cust_budget;
$comments.='<br><br> <b>Wunschdatum: </b>'.$dp;
$comments.='<br> <b>Beginn: </b>'.$tp;
$comments.='<br><br> <b>Catering: </b>'.$person_no;
$comments.='<br> <b>Getränke: </b>'.$drinks;
$comments.='<br><br> <b>Nachricht: </b>'.$cust_nachricht;
}
if($_POST['formid']=='contactForm')
{
$name=$cust_name=$_POST['cust_name'];
$email=$_POST['cust_email'];
$email_to_send_to='info@formidable-events.de';
$email_subject="Contact";
$comments=$_POST['comments'];
}
if($_POST['formid']=='our-event-form')
{
$custName=$_POST['custName'];
$cust_phone=$_POST['cust_phone'];
$name='Admin';
$email='info@formidable-events.de';
$email_to_send_to=$_POST['custEmail'];
$email_subject="AWESOME SPICES - Event Join Confirmation";
$eventName=$_POST['eventName'];
$eventPrice=$_POST['eventPrice'];
$eventPerson=$_POST['eventPerson'];
$comments='Hello '.$cust_name;
$comments='<br><br><br>The following are the details of the event you joined:<br> ';
$comments.='<br> Name :'.$custName;
$comments.='<br> Event name :'.$eventName;
$comments.='<br> No. of person :'.$eventPerson;
$comments.='<br> Price of event :'.$eventPrice;
}
if($_POST['formid']=='order-form')
{
$orderName=$_POST['orderName'];
$orderPhone=$_POST['orderPhone'];
$name='Admin';
$email='info@formidable-events.de';
$email_to_send_to=$_POST['orderEmail'];
$email_subject="AWESOME SPICES - Order Confirmation on ".date('M-d-Y');
$orderAddress=$_POST['orderAddress'];
$orderPincode=$_POST['orderPincode'];
$comments='Hello '.$orderName;
$comments.='<br><br><br>The following are the details of the order you placed:<br> ';
$comments.='<br> Name :'.$orderName;
$comments.='<br> Address :'.$orderAddress;
$comments.='<br> Pincode :'.$orderPincode;
$comments.='<br> Phone no. :'.$orderPhone;
$comments.='<br><br>';
$str='<table style="width:100%;">';
$str.='<tr>
<td style="text-decoration: underline; width: 300px;">Item Name</td>
<td style="text-decoration: underline;">Price</td>
</tr>';
$dishes=explode("|",$_POST['dishes']);
for($i=0;$i<count($dishes);$i++)
{
$dish=explode(":",$dishes[$i]);
$str.='<tr>
<td>'.$dish[0].'</td>
<td>'.$dish[1].'</td>
</tr>';
}
$str.='</table>';
$comments.=$str;
$headers= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable' . "\r\n";
$headers.= 'From: '.$name.'<'.$email_to_send_to.'> ' . "\r\n" .'Reply-To: '.$email_to_send_to.' ' . "\r\n" .'X-Mailer: PHP/' . phpversion();
$toadmin = 'Name :'.$orderName;
$toadmin.= '<hr><br>'.$str;
@mail($email,$email_subject,$toadmin,$headers);
$headers='';
}
$headers= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable' . "\r\n";
$headers.= 'From: '.$name.'<'.$email.'> ' . "\r\n" .'Reply-To: '.$email.' ' . "\r\n" .'X-Mailer: PHP/' . phpversion();
$ret = @mail($email_to_send_to,$email_subject,$comments,$headers);
if(!$ret){
echo 'Nachricht konnte nicht gesendet werden, bitte versuchen Sie es direkt an info@formidable-events.de';
}else{
echo 'Nachricht erfolgreich gesendet!';
}
die();
?>
PHP-Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<!-- <meta http-equiv="X-UA-Compatible" content="IE=Edge"> -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="dist/font-awesome.css">
<link rel="stylesheet" href="dist/jquery.bxslider.css">
<link rel="stylesheet" href="dist/animate.css" media="screen" />
<link rel="stylesheet" type="text/css" href="dist/jquery.datetimepicker.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="dist/desktop.css">
<link rel="stylesheet" href="dist/tab.css">
<link rel="stylesheet" href="dist/mobile.css">
<!--[if IE]>
<script src="_assets/js/html5shiv.js"></script>
<link rel="stylesheet" href="dist/ie9.css">
<![endif]-->
<script src="_assets/js/modernizr.custom.50095.js"></script>
<script src="_assets/js/respond.js"></script>
</head>
Kommentar