Thread [php] Problem mit Formularfelderüberprüfung und UTF-8 (103 answers)
Opened by Tom at 2008-10-04 14:02

GwenDragon
 2010-11-20 19:11
#142929 #142929
User since
2005-01-17
14607 Artikel
Admin1
[Homepage]
user image
Nicht von wo nach wo.
Alles ist UTF-8 und soll als Mail mit PHPs mail versandt werden.

Testskript (als UTF-8 kodierte Source!):
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?
setlocale(LC_ALL, 'de_DE.UTF-8');
$_POST['Betreff']='ÄÖÜß Test 1€';
$_POST['Absender']='"ÄÖÜß Test" <a@local>';
$_POST['Text']='
Aha!

Soso!

ÄÖÜß

';
mail('email@local',
"Subject: " . mb_encode_mimeheader($_POST['Betreff'], 'utf-8', 'Q'),
$_POST['Text'],
'From: ' . mb_encode_mimeheader($_POST['Absender'], 'utf-8', 'Q') . "\n"
. 'Content-Type: text/plain; charset="utf-8"' . "\n"
. 'Content-Transfer-Encoding: 8bit'
);
?>

Last edited: 2010-11-20 19:12:49 +0100 (CET)

View full thread [php] Problem mit Formularfelderüberprüfung und UTF-8