1

I've got a little script to send data via ajax to my phpmailer in mailer.php The E-Mail will send successfully but I have problems with the German umlaute (ä,ö,ü,ß).

I receive the Mailcontent: "Beratung erwünscht" like this: "Beratung erwünscht"

How can I send the mail with UTF-8?

// load the variables form address bar
$contact_name    = $_POST["contact_name"];
$contact_surname = $_POST["contact_surname"];
$contact_email   = $_POST["contact_email"];
$contact_tel     = $_POST["contact_tel"];
$contact_comment = $_POST["contact_comment"];
$contact_1h      = $_POST["contact_1h"];

// remove the backslashes that normally appears when entering " or '
$contact_comment = stripslashes($contact_comment); 
$contact_email = stripslashes($contact_email ); 

$body= '
Kontaktformular:
Name:               '.$contact_name.' '.$contact_surname.'
E-Mail:             '.$contact_email.'
Telefon:            '.$contact_tel.'
Beratung erwünscht: '.$contact_1h.'

Nachricht:
'.$_POST['contact_comment'].'

Fragebogen Feedback:
';


mail("mail@address.de", 'Fragebogen Feedback', $body, "From: $contact_email");

Other soluions are not using mail() I'm a bloody beginner, with those little code snippets, I can't fix my problem.

Archer
  • 1,062
  • 1
  • 13
  • 32

0 Answers0