Re: Re: Email screwing my swedish characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 06/28/2005 12:23 AM Ryan A said the following:
<snip>
when someone joins the site they get a welcome letter, but
unfortunatly in
the welcome letter
the Swedish characters ÖÅÄ and öåä are getting replaced with a "?"
(without quotes)
</snip>

<snip2>
You cannot send messages with 8 bit characters. To send your message you
need to encode the body using quoted-printable encoding.

You may want to take a look at this class for composing and sending
messages
http://www.phpclasses.org/mimemessage
</snip2>


That really helps but I would rather not use a whole class for this little
problem,
is there any small piece of code I could use instead?

You can use the class function QuotedPrintableEncode. It also takes care of encoding the message headers that have 8 bit characters with q-encoding which is slightly different from quoted-printable. You also need to set the Content-Transfer encoding to quoted-printable.

That is all if you want to send just a plain text message. If you messages are more complicated with HTML parts, embedded images or attachments, that is more complicated. You would need to use the whole class rather than just a single function.

The actual delivery of the message also has details. There are differences when you send via SMTP or sendmail (or equivalent). The class and its sub-classes take care of all those differences too.

--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux