Re: Re: character set when sending emails with PHP

From: Date: Wed, 30 Aug 2006 09:48:01 +0000
Subject: Re: Re: character set when sending emails with PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-241214@lists.php.net to get a copy of this message
Manuel Lemos wrote:
Hello, on 08/29/2006 09:04 AM Angelo Zanetti said the following:
I have various PHP CRONTAB scripts that run and send automated emails to people, the subject often contains the "TM" character: ™, in most of the email clients the character shows correctly but in some webmail applications the character is replaced with a square, it obviously doesnt recognise the character. Now if I forward one the mails from the email client to the webmail account it then recognises and shows the character correctly? Very weird as it is the same mail just forwarded, is the problem that the mail forwarded from the email client uses a different content type when sent? The one specified in the PHP script is as follows: $mail->setHeader("Content-type", "text/plain; charset=iso-8859-1"); Or is there something wrong with the charset that I'm specifying above?
The content-type header only applies to that message body part. The character set of the headers is defined in a different way using q-encoding. Take a look at this class that lets you define headers with whatever encoding and character set you need to use: http://www.phpclasses.org/mimemessage hi Manuel.
thanks for the reply, I've got the classes now how do I know which character set to use for the TM to be shown correctly? Thanks in advance. -- ------------------------------------------------------------------------ Angelo Zanetti Systems developer ------------------------------------------------------------------------ *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:* +27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* angelo@zlogic.co.za <mailto:angelo@zlogic.co.za>

« previous php.general (#241214) next »