The problem with the encoding of the html message on mail.ru

There is a php script that sends data to the customer's e-mail. I checked the work on Yandex mail and gmail, everything is fine. On mail.ru krakozyabry instead of Russian characters, the encoding is specified explicitly in the message body, in the message header, in the page header. I tried utf-8, win-1251, win-1252, koi8-r, the character type changes, but the normal Russian text is not displayed. I use the phpmailer class for authorization and sending emails. What could be the problem?

Author: Alex, 2015-04-15

1 answers

In order for the Cyrillic alphabet to be displayed correctly in the mailboxes mail.ru you need to convert the content to windows-1251. Also make sure that at the end of the line connecting the encoding there is a line translation character.

$body.="Content-type: text/html; charset=\"windows-1251\"\n";

The \n character at the end is required. In general, without providing the header code, it is difficult to say what the problem is. One more clarification in what encoding is the page from which you send the message? The page must be in the same encoding in which you send the message.

 1
Author: Nikolaj Sarry, 2015-04-16 07:52:07