M
M
Maxim Grechushnikov2014-09-03 11:41:10
1C-Bitrix
Maxim Grechushnikov, 2014-09-03 11:41:10

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);

mail is trying to go at the time of registration / subscription,
what am I doing wrong? why doesn't cron work?
at the same time, resending the confirmation code works on the crown
. Secondly,
I did such a thing
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');

he gave me
Array
(
    [0] => [email protected]
    [1] => =?UTF-8?B?0KHQv9C10LrRgtGA0LDRgdC+0YTRgjog0J/QvtC00YLQstC10YDQtg==?=
   =?UTF-8?B?0LTQtdC90LjQtSDQv9C+0LTQv9C40YHQutC4?=
    [2] => Информационное сообщение сайта блаблабла


what happens to the 2nd parameter?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vladkras, 2016-01-19
@vladkras

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.

A
Arthur Ilyin, 2021-07-06
@ArtuRus_2k02

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 question

Ask a Question

731 491 924 answers to any question