W
W
WeStlik2021-02-23 23:53:25
PHP
WeStlik, 2021-02-23 23:53:25

Why doesn't SMTP send Russian characters to mail?

There is a function of sending a letter with Russian text
If you send mail to Yandex / Gmail - everything is sent as it should.
If you send it to Mail.ru, then the Russian text simply will not reach

Gmail:

spoiler
PIHmWo7.png


Mail:
spoiler
Bt3JzOs.png


How to ship:
spoiler

WgBzUoM.png
bWrucah.png
NVig26b.png

* Encoding set to UTF-8 ($config['smtp_charset'])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2021-02-24
@WeStlik

Three simple steps to solve this problem:
1. Look at the calendar and clarify what century it is in the yard.
2. Carefully select this code and press the Del button
3. Download phpmailer
4. Forget all these handicraft picks like a bad dream.
As a result, the code should look something like this:

require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->setFrom('[email protected]', 'First Last');
$mail->addAddress('[email protected]', 'John Doe');
$mail->Subject = 'PHPMailer file sender';
$mail->msgHTML("My message body");
$mail->send();

it should be understood that sending mail is not just copying into your script some specific combinations of characters that accidentally worked in the last century for the author of some antediluvian article. This is a much more complex process, which includes many nuances. And therefore, sending mail should not be manually sculpted on the go from manure and sticks, but entrusted to a proven and debugged solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question