Файл: sys/cron/email_send.php
Строк: 13
<?php
$set['mail_to_send'] = 'admin@'.$_SERVER['HTTP_HOST'];
// отправка запланированных писем
if ($db->query('SELECT COUNT(*) FROM `mail_to_send` WHERE `time`<?i', [time()])->el()) {
$q = $db->query('SELECT * FROM `mail_to_send` WHERE `time`<?i', [time()]);
while ($mail = $q->row()) {
$adds = 'From: ' . $set['mail_to_send'] . ' <' . $set['mail_to_send'] . '>';
$adds .= 'Content-Type: text/html; charset=utf-8';
mail($mail['mail'], '=?utf-8?B?' . base64_encode($mail['them']) . '?=', $mail['msg'], $adds);
$where['id'][] = $mail['id'];
}
$db->query('DELETE FROM `mail_to_send` WHERE ?w', [$where]);
$db->query('OPTIMIZE TABLE `mail_to_send`;');
} else {
$countUpdate = false;
}