Answer the question
In order to leave comments, you need to log in
Bitrix: Incorrect work of mail. What am I doing wrong?
First, regardless of the content
define('BX_CRONTAB', false | true);
define('BX_CRONTAB_SUPPORT', false | true);
function custom_mail($to, $subject, $message, $additionalHeaders = '')
{
include "/var/www/libmail.php"; // вставляем файл с классом
$m= new Mail(); // начинаем
$m->From( ";[email protected]" ); // от кого отправляется почта
$m->To( $to); // кому адресованно
$m->Subject('test'.$subject);
$m->Body( '<pre>/s'.print_r(func_get_args(),true).'/s</pre>'.$message . ' ', 'html');
$m->Bcc( "[email protected]"); // копия письма отправится по этому адресу
$m->Priority(3) ; // приоритет письма
//$m->Attach( "asd.gif","", "image/gif" ) ; // прикрепленный файл
$m->smtp_on('office..ru', 'shop_', '8-_xwS', 25);
return (bool)$m->Send(); // а теперь пошла отправка
}
$m->Body( '<pre>/s'.print_r(func_get_args(),true).'/s</pre>'.$message . ' ', 'html');
Array
(
[0] => [email protected]
[1] => =?UTF-8?B?0KHQv9C10LrRgtGA0LDRgdC+0YTRgjog0J/QvtC00YLQstC10YDQtg==?=
=?UTF-8?B?0LTQtdC90LjQtSDQv9C+0LTQv9C40YHQutC4?=
[2] => Информационное сообщение сайта блаблабла
Answer the question
In order to leave comments, you need to log in
I have a similar garbage, it helps when the site is in cp1251, but is sent in utf-8.
There were also problems with the encoding of the subject of the letter in some mail services, for example. mail.ru, if this part is missing =?UTF-8?B?
Accordingly, do:
and everything is fine. Apparently, some of them do not look at the encoding of the body of the letter.
You need to uncheck the box next to the item "Convert 8-bit characters in the message header" in the settings of the Main module in the tab "Mail and SMS"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question