common_cadline_libraries (CRM hardlock/db/users classes; upstream cadline_web/cadcommonlib), maintenance/ (ARCHLine.XP license backend; upstream cadline_web/maintenance), maintenance2/. Vetted live files (byte-truth); upstream repos in PROVENANCE.md. NOTE: could be git submodules — kept as live files for byte-fidelity. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
96 lines
2.3 KiB
PHP
96 lines
2.3 KiB
PHP
<?php //if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||
|
||
require_once('libraries/mmail/htmlMimeMail.php');
|
||
include("../configuration.php");
|
||
|
||
class CI_Email extends htmlMimeMail5
|
||
{
|
||
function __construct()
|
||
{
|
||
parent::__construct();
|
||
//$this->CI = &get_instance();
|
||
}
|
||
|
||
function initialize($settings = false)
|
||
{
|
||
if (!$settings) {
|
||
//$settings = $this->CI->config->item('email');
|
||
$conf = new JConfig();
|
||
$settings['host'] = $conf->smtphost;
|
||
$settings['port'] = $conf->smtpport;
|
||
$settings['helo'] = null;
|
||
$settings['auth'] = $conf->smtpauth;
|
||
$settings['user'] = $conf->smtpuser;
|
||
$settings['pass'] = $conf->smtppass;
|
||
/*$settings['host'] = 'localhost';
|
||
$settings['port'] = 25;
|
||
$settings['helo'] = null;
|
||
$settings['auth'] = true;
|
||
$settings['user'] = 'www.smtp@cadline.hu';
|
||
$settings['pass'] = 'Chieng0t';*/
|
||
}
|
||
|
||
$this->setSMTPParams($settings['host'], $settings['port'], $settings['helo'], $settings['auth'], $settings['user'], $settings['pass']);
|
||
|
||
$this->setHTMLCharset('UTF-8');
|
||
$this->setHeadCharset('UTF-8');
|
||
$this->setHTMLEncoding(new EightBitEncoding());
|
||
}
|
||
|
||
function addOfficialImages()
|
||
{
|
||
$this->addEmbeddedImage(new fileEmbeddedImage('../public/img/mail/title.jpg'));
|
||
$this->addEmbeddedImage(new fileEmbeddedImage('../public/img/mail/footer.jpg'));
|
||
}
|
||
|
||
function addImage($path)
|
||
{
|
||
$this->addEmbeddedImage(new fileEmbeddedImage('../public/img/' . $path));
|
||
}
|
||
|
||
function clear()
|
||
{
|
||
$this->is_built = false;
|
||
$this->setHTML(null);
|
||
$this->setFrom(null);
|
||
}
|
||
|
||
function message($html)
|
||
{
|
||
$tomb['<27>'] = 'á';
|
||
$tomb['<27>'] = 'Á';
|
||
$tomb['<27>'] = 'é';
|
||
$tomb['<27>'] = 'É';
|
||
$tomb['<27>'] = 'ó';
|
||
$tomb['<27>'] = 'Ó';
|
||
$tomb['<27>'] = 'ö';
|
||
$tomb['<27>'] = 'Ö';
|
||
$tomb['<27>'] = 'ő';
|
||
$tomb['<27>'] = 'Ő';
|
||
$tomb['<27>'] = 'ú';
|
||
$tomb['<27>'] = 'Ú';
|
||
$tomb['<27>'] = 'ü';
|
||
$tomb['<27>'] = 'Ü';
|
||
$tomb['<27>'] = 'ű';
|
||
$tomb['<27>'] = 'Ű';
|
||
$tomb['<27>'] = 'í';
|
||
$tomb['<27>'] = 'Í';
|
||
|
||
$string = $html;
|
||
foreach ($tomb as $k => $v) {
|
||
$string = str_replace($k, $v, $string);
|
||
}
|
||
$this->setHTML($string);
|
||
}
|
||
|
||
function from($from)
|
||
{
|
||
$this->setFrom($from);
|
||
}
|
||
|
||
function subject($subj)
|
||
{
|
||
$this->setSubject($subj);
|
||
}
|
||
}
|