Re: PROBLEM WITH MAIL FUNCTION
| From: | Manuel Lemos | Date: | Mon, 10 Jul 2006 01:11:54 +0000 |
| Subject: | Re: PROBLEM WITH MAIL FUNCTION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239225@lists.php.net to get a copy of this message | ||
Hello,
Juanjo Pascual wrote:
> I have a problem with the mail function when I send a mail with acents
> or Ñ in the subject. When I receive the mail this caracters have been
> replaced by X.
>
> I'm using the mail function in this way:
>
> mail(zzz@zzzz.com, 'Consulta Señalítica desde la página web',
> '<strong>Hola, esto es una prueba<strong>','From: zzz@zzzz.com'
> . "\r\n"
> . 'Content-type: text/html; charset=iso-8859-1' . "\r\n");
>
> The mail subject when I receive the message is like this: Consulta
> SeXalXtica desde la pXgina web
>
> ¿How can I solve this problem?
Headers with non-ASCII characters must be encoded with q-encoding.
If you do not know how to encode headers that way, you may want to try
this class for composing and sending MIME messages that can encode
headers as needed. Take a look at the test_email_message.php example
script that shows how to send messages with accents like you are using:
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/