Re: Sending UTF-8 mail with mail()
| From: | Manuel Lemos | Date: | Tue, 13 Jun 2006 21:48:54 +0000 |
| Subject: | Re: Sending UTF-8 mail with mail() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237927@lists.php.net to get a copy of this message | ||
Hello,
on 06/13/2006 01:37 PM Peter Lauri said the following:
> Yes, that class I am aware of. However, I only want to send text/plain
> messages, not MIME messages.
MIME includes plain text messages. MIME is what is called the set of
standard rules defined in RFC documents for sending e-mail. 8 bit text
must be encoded as quoted-printable as defined in RFC 2045 or else you
will have the problems that you have described:
http://www.ietf.org/rfc/rfc2045.txt
> -----Original Message-----
> From: Manuel Lemos [mailto:mlemos@acm.org]
> Sent: Wednesday, June 14, 2006 4:36 AM
> To: Peter Lauri
> Cc: php-general@lists.php.net
> Subject: Re: Sending UTF-8 mail with mail()
>
> Hello,
>
> on 06/13/2006 06:09 AM Peter Lauri said the following:
>> How can I send UTF-8 mails with the mail() function. Right now I am doing:
>>
>> mail('theemail@domain.com', 'Subject', 'Message',
>> "From: The Sender <sender@domain.com> \n" .
>> "Content-Type: text/plain; charset=utf-8 \n" .
>> "Content-Transfer-Encoding: 7bit\n\n")
>>
>> The message is being sent, but the UTF-8 specific characters are not being
>> presented. Is there any fix on this?
>>
>> The messages etc are coming from a form. Is it possible to set the charset
>> for the form?
>
> UTF-8 text is 8 bit. You must encode that message with quoted-printable,
> not 7 bit.
>
> If you don't know how to do it right, you may want to try this class.
> Try the test_email_message.php example that demonstrates how to send
> messages with non-ASCII characters.
>
> The default encoding is ISO-8859-1 but if you have text already encoded
> as UTF-8, you can just set the default_charset class variable to 'UTF-8'
> to make the messages be sent correctly.
>
> 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/