Page 1 of 1

Multilanguage in PHP feedback forms

Posted: Tue Feb 24, 2004 12:24 pm
by silverphpd
Hi,

When I send non-English text in PHP online feedback forms, it comes as garbage in email client.

The webpage has 'charset=UTF-8' so it gets & sends right text, the php script use right mail call as here:
mail($mailto, $subject, $message,
"From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.01" );

Please advice how it can be fixed.
Thanks.

Posted: Tue Feb 24, 2004 3:18 pm
by Fredix
Hm, hard to say. Actually German Umlaute should work but you probably mean something really diffrent like Russian or Chinese. Maybe you need to do something with the main headers?
Read the user's comments in the mail manual [php_man]mail[/php_man] to learn how to control the mail headers.

BUT this is just my guess!

Posted: Tue Feb 24, 2004 8:42 pm
by silverphpd
Fredix wrote:...Maybe you need to do something with the main headers?...
Fredix, you are right. I fixed it, now the other problem.
My email, comming from online PHP form, lost all newline characters.

It happend after I added additional header for PHP mail() call, like this one:

MIME-Version: 1.0\nContent-type: text/html; charset=utf-8

How can I get newline characters back?
Thanks.

Posted: Wed Feb 25, 2004 6:44 am
by Fredix
MIME-Version: 1.0\nContent-type: text/html; charset=utf-8

means that you send a html file as a mail, therefore linebreaks must be also done with html <br />

btw: sending html mails means that you are sure that all your clients are able to read a html formatted email! (if they do not have the software for it but use text-only software PROBABLY they will be able to read the mail but also will see <p>, <br />, ... as text)

Posted: Wed Feb 25, 2004 7:52 am
by silverphpd
Thanks a lot. Now it's fixed.