phpmailer with umlaut(mutated vowel)

时间:2016-01-10 11:28:26

标签: php email utf-8 phpmailer diacritics

我有一个小脚本通过ajax将数据发送到mailer.php中的phpmailer 电子邮件将成功发送,但我有德国元音(ä,ö,ü,ß)的问题。

我收到了Mailcontent:“Beratungwünscht”,就像这样:“Beratungerwünscht”

如何使用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");

其他解决方案未使用mail() 我是一个血腥的初学者,有了那些小代码片段,我无法解决我的问题。

0 个答案:

没有答案