You are here: Re: mail() encoding problems « PHP Programming Language « IT news, forums, messages
Re: mail() encoding problems

Posted by Manuel Lemos on 08/21/07 23:15

Hello,

on 08/19/2007 11:16 AM amygdala said the following:
> Sometimes, when I run in to the problem I change the following lines in my
> send() function to utf8 encoding
>
> $headers .= 'Content-Type: text/plain; charset=utf-8' . LF;
>
> $body = utf8_encode( $this->body );
>
> Then, it seems to work for a while. But then all of a sudden it shows the
> same problem again. Eventhough I send the same test mail.
>
> The body content I send is:
>
> test ëèï
>
> Which shows up as:
>
> test ëèï
>
> Does anybody have any idea what might be causing this weird problem?

Those are the characters you typed encoded as UTF-8. It seems correct
but pointless. If you have only windows-1252 characters, there is no
need to convert them into utf-8. It is not wrong but it is useless.

The only thing really wrong is that you should not send 8 bit encoded
messages as many mail gateways do not supported. Instead of 8 bit you
should use quoted-printable encoding.

You can also have 8 bit characters in the headers but they must be
encoded with q-encoding to avoid the same problem with the message body.

This is a bit complicated to encode by hand. I use this MIME message
composing and sending class to take care of all that for me.

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация