Re: [FX.php List] (mail) - problems with Æ - Ø - Å

Erik Andreas Cayré erik at cayre.dk
Mon Apr 30 23:34:09 MDT 2007


Den 01/05/2007 kl. 6.15 skrev Baard Belsaas:

> Hello, I have a send mail in my fx.php-site. I use the php-code "  
> mail()".
> When there is a æ/Æ, ø/Ø or å/Å in the data from FileMaker, the  
> text in the
> mail come with "wrong text". The letters print like this:
> æ = æ
> Æ = Æ
> ø = ø
> Ø = Ø
> å = å
> Å = Å
>
> Someone out there nowes anything about this? Please...
>
>
> Baard

Hi Baard,

The text from Filemaker is HTML-encoded by FX.php, ready to show on a  
webpage.

Use html_entity_decode() on the text going into you email. It uses  
ISO-8859-1 by default, which is fine for most purposes.

Example:
$to = html_entity_decode($_SESSION['order']['customername'] . ' <' .  
$_SESSION['order']['customeremail'] . '>');
$subject = 'Your order ' . $_SESSION['order']['id'];

// Convert HTMLencoding to ISO 8859-1
$message = unhtmlentities($message);


// headers

$mailheaders = 'From: websitename <noreply at domain>' . '
' .'Reply-To: Customer Service <service at domain>' . '
' .'Bcc: secretrecipient <007 at otherdom>' . '
' . 'MIME-Version: 1.0' . '
' . 'Content-type: text/plain; charset=ISO-8859-1' . '
' . 'Content-Transfer-Encoding: quoted-printable' . '
' . 'X-Mailer: MyMagicMailer';

// send mail receipt

	mail($to, $subject, wordwrap($message, 70), $mailheaders);

Best regards

---
Erik Andreas Cayré
Spangsbjerg Møllevej 169
6705 Esbjerg Ø

Privat Tel: 75150512
Mobil: 40161183

---
»Interesse kan skabe læring på en skala sammenlignet med frygt, som  
en nuklear eksplosion i forhold til en kineser.«
--Stanley Kubrick

»Kun p....sure mennesker kan ændre verden. Innovation skabes ikke af  
'markedsanalyse', men af folk, der er afsindigt irriterede over  
tingenes tilstand «
--Tom Peters

»Hvis du ikke kan forklare det simpelt, forstår  du det ikke godt nok.«
-- Albert Einstein

»Hvis du ikke har tid til at gøre det rigtigt, hvornår vil du så have  
tid til at lave det om?«
-- John Wooden, basketball coach




More information about the FX.php_List mailing list