Why not change the status of the distribution release?

Hello! Create a newsletter examples:

$arFields = array( 
 'STATUS' => 'D', 
 'BCC_TO_SEND' => "client@example.ru", 
 'FROM_FIELD' => "admin@example.ru",
 'SUBJECT' => 'message Subject', 
 'BODY_TYPE' => 'text', 
 'BODY' => 'message Body', 
 'RUB_ID' => 1, 
 'DIRECT_SEND' => 'Y', 
 'CHARSET' => 'UTF-8', 
); 

$posting = new CPosting; 

$ID = $posting->Add($arFields); 
if ($ID) {
 $posting ->ChangeStatus($ID, "P");
$posting->AutoSend($ID);
}


The issue is created correctly but remains in the status "Draft". Accordingly, sending either. What could be the problem?
March 23rd 20 at 19:41
0 answer

Find more questions by tags 1C-Bitrix