A
A
Alexey Nikolaev2014-10-02 23:12:20
PHP
Alexey Nikolaev, 2014-10-02 23:12:20

Why, when sending mail with a return address containing Russian letters, unreadable characters appear instead of some of them?

Sending mail via phpMailer:

$mail->From = "[email protected]имя-сайта.рф";
$mail->FromName = "Robot";
$mail->AddAddress($toEmail);
$mail->Subject  = $subject;
$mail->Body = $template;
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
if(!$mail->Send()) {
// ...
}

Everything is sent and works fine, but in some mailers (for example, mail.ru) there is an incomprehensible problem: with the correct encoding of the entire letter, some letters from "site-name.rf" are not displayed. I would understand if the whole address was not displayed, but individual letters ... in the end it looks something like this:
226c1d2659e0428884e14ab36cd3108d.JPG
Moreover, a mailbox with the same name was created on the hosting.
I don’t understand at all where to dig in this situation ... I will be grateful for any advice, thanks.
UPDATE
Solved the problem by writing Cyrillic in punycode.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Nikolaev, 2014-10-03
@Heian

I solved the problem by writing Cyrillic in punycode.

R
realt, 2014-10-03
@realt

$email = "[email protected]имя-сайта.рф";
$send = mail ("Content-type:text/plain; charset = UTF-8\r\nFrom:$email");

...
something like this...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question