When I send an email containing £ using PHP mail it appears in outlook/hotmail as £. In Gmail/thunderbird it’s fine.
Any idea how I can fix this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem is, the client doesn’t know what encoding is used to encode the subject. Whatever your application sets in
Content-Typeheader only applies to the body of the email, not the headers.Usually this affects the following headers:
In order to use different encodings your internationalized header lines should be MIME-encoded (as of RFC 2047), using one of the two methods: base64 (B) or modified quoted-printable (Q). The encoded subject usually looks like this:
This may look difficult, but there is one very handy helper function in PHP which does all the magic:
Alternatively you may look into discussion under:
Before using
quoted_printable_encode()directly you neet to take into account that long lines need to be split at certain length and spaces need to be replaced with underscore “_”.