base_object = $base_object;
}
function send_mail($subject, $message, $recipient = false, $logo = false, $recipients_from_db = false, $reply_to = false, $from_mail = false, $from_name = false, $attachments = false) {
date_default_timezone_set("Europe/Berlin");
$subject = utf8_decode($subject);
$from_name = ($from_name) ? mb_encode_mimeheader(utf8_decode($from_name), "UTF-8", "Q") : false;
$recipients['to'] = ($recipient) ? $recipient : $global_mail_settings['mail_to']['global'];
include_once 'Mail.php';
include_once 'Mail/mime.php';
$email = $this->base_object->config->shopConfiguration['system_email'];
$from_mail = $this->base_object->config->shopConfiguration['system_email'];
$host = $this->base_object->config->shopConfiguration['system_email_host'];
$user = $this->base_object->config->shopConfiguration['system_email_user'];
$pass = $this->base_object->config->shopConfiguration['system_email_password'];
$from_name = $this->base_object->config->shopConfiguration['system_email_name'];
$reply = '';
$crlf = "\n";
$hdrs = array(
'From' => (($from_name) ? $from_name : $user).' <'.(($from_mail) ? $from_mail : $reply).'>',
'Sender' => $name.' <'.$email.'>',
'Reply-To'=> (($reply_to) ? $reply_to : $reply),
'Subject' => $subject,
'To' => $recipients['to'],
'Cc' => $recipients['cc'],
'Bcc' => $recipients['bcc']
);
$mime = new Mail_mime($crlf);
$inline_message = '';
/*if ($logo) {
if ($logo == 'intern') {
$mime->addHTMLimage(ROOT_DIR.'web/'.SHOP_SYSTEM.'/images/static/logo4mail2.jpg', 'image/jpeg');
$inline_logo = '
';
$inline_message .= 'ELISA - Easyway-Shop Live Information Services and Announcements';
} else if ($logo == 'extern') {
$inline_message .= $global_mail_settings['inline_text'];
$mime->addHTMLimage(ROOT_DIR.'web/'.SHOP_SYSTEM.'/themes/'.THEME.'/images/logo4mail.jpg', 'image/jpeg');
$inline_logo = '
';
}
} else {*/
$inline_logo = '';
//}
// read css file
$file_name = $this->base_object->layout->template_dir.'/../media/css/mail.css';
if (file_exists($file_name)) {
$handle = fopen($file_name, "r");
$css = '';
while (!feof($handle)) {
$css .= fgets($handle,2);
};
fclose($handle);
}
$mime->setHTMLBody('