naiquevin
naiquevin

Reputation: 7796

Spanish characters in email appearing as question mark in mail clients

I am using an already written Mail class in php. Emails are mostly sent in spanish language. Following are the headers being passed to the php mail function -

MIME-Version: 1.0
Content-Type: multipart/mixed;

Also additional headers are being appended to the message (don't know what it does),

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Emails appear properly in browsers but in mail clients, accented characters are replaced by question marks

for eg:

Una nueva contraseña se solicito 

appears

Una nueva contrase�a se solicito

have checked this in Thunderbird and outlook

How do I fix this to show these characters correctly in mail clients as well

Upvotes: 0

Views: 2716

Answers (3)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798666

The email is probably being sent out as something other than UTF-8. Make sure to convert the text to UTF-8 before passing it to the class (or convert it to UTF-8 in the class).

Upvotes: 1

Jonathan Lafleur
Jonathan Lafleur

Reputation: 493

Like Raffael say the client have to be in UTF-8 too, the better solution is to pass with htmlentities before sending the mail and display the mail as HTML

Upvotes: 0

Raffael
Raffael

Reputation: 20045

I guess you have to change the character set to UTF-8 in Thunderbird and Outlook as well.

Upvotes: 1

Related Questions