| Current Path : /var/www/iplanru/data/www/i-plan.ru/modules/mod_mysendmail/tmpl/ |
| Current File : /var/www/iplanru/data/www/i-plan.ru/modules/mod_mysendmail/tmpl/default.php |
<?php
// No direct access
defined( '_JEXEC' ) or die;
$db =&JFactory::getDBO();
$list = $db->setQuery( "SELECT * FROM #__pay_mail order by id" )->loadAssoc();
if (!empty($list))
{
$mailer =& JFactory::getMailer();
$conf = new JConfig();
$sender = array(
$conf->mailfrom,
$conf->fromname);
$mailer->setSender($sender);
$mailer->addRecipient($list['to']);
$mailer->setSubject($list['subject']);
$mailer->isHTML(true);
$mailer->Encoding = 'base64';
$mailer->setBody($list['msg']);
if ($list['images']<>''){
$mailer->AddEmbeddedImage($list['images'],'image_id', 'image.jpg', 'base64', 'image/jpeg');}
if ($list['files']<>''){
$mailer->addAttachment($list['files']);}
$send =& $mailer->Send();
if ( $send == true ) {
if ($list['images']<>'') {unlink($list['images']);}
if ($list['files']<>'') {unlink($list['files']);}
$query = "DELETE FROM #__pay_mail where id={$list['id']}";
$db->setquery($query);$b=$db->query($query);
}
}
?>