views:

430

answers:

3

I have a small web form which will cause a PHP script to send a receipt upon clicking the submit button, by an HTML mail. This mail contains special characters, namely 'å', 'ä' and 'ö'. Whatever I try, I can't get these characters to display properly everywhere. In some email clients, these characters show up just fine, whereas in others they show up as question marks. I've tried sending the mail as UTF-8, as ISO-8859-1, base-64 encoding the subject, but I'm seriously stumped.

How do I send a mail from PHP using any characters while guaranteeing that the mail shows up the same everywhere?

+2  A: 

UTF-8 should be enough, the problem could be in how are you sending emails. I would suggest using an already proven library like PHPMailer.

pablasso
+1  A: 

Try using phpMailer or the pear mime_mail classes.

The phpMailer website looks horrible but it actually has a nice and easy to use mailer class. It will take care of everything, you just have to specify the right encoding. (utf-8 or ascii)

Prody
+1  A: 

Another option asside from the above is swift mailer - http://swiftmailer.org/

Jake Worrell