Show UTF-8 in the Subject of the mail

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've written the following codes to include utf-8 wordings in both the
subject and the content.

      $headers = "MIME-Version: 1.0\r\n".
          "Content-type: text/plain; charset=utf-8\r\n".

      mail("", "<some utf-8 wordings as subject>",
"<Another utf-8 wordings as content>", $headers);

In the email received, the content is fine , however, the subject
becomes 'strange characters'... How to solve this problem? Thanks a lot.

Re: Show UTF-8 in the Subject of the mail wrote:

Quoted text here. Click to load it

Check out RFC 2047.  You can use something like:
    Subject:  =?utf-8?b?...base64-encoded-subject...?
    Subject:  =?utf-8?q?...quoted-printable-subject...?
- Tim Roberts,
  Providenza & Boekelheide, Inc.

Site Timeline