Файл: adultscript-2.0.3-pro/files/admin/modules/email/scripts/send.php
Строк: 15
<?php
define('_VALID', TRUE);
define('_CONSOLE', TRUE);
set_time_limit(0);
$base_dir = realpath(dirname(__FILE__).'/../../../../');
require $base_dir.'/libraries/bootstrap.php';
if (isset($_SERVER['argv']['1'])) {
$random = VF::factory('filter')->clean($_SERVER['argv']['1']);
$file = TMP_DIR.'/emails/'.$random.'.php';
if (file_exists($file) && is_file($file) && is_readable($file)) {
$array = unserialize(VFile::read($file));
$from = $array['from'];
$receivers = $array['receivers'];
$subject = $array['subject'];
$message = $array['message'];
unlink($file);
$mail = VF::factory('email');
$mail->From = $from;
if ($from == $cfg['email_admin']) {
$mail->FromName = $cfg['site_name'];
}
$mail->Sender = $from;
$mail->AddReplyTo($from);
$mail->Subject = $subject;
$mail->AltBody = $message;
$mail->Body = nl2br($message);
foreach ($receivers as $address) {
$mail->AddAddress($address);
$mail->Send();
$mail->ClearAddresses();
}
}
}
?>