Email config (#2968)

This commit is contained in:
jekkos-t520
2020-10-17 01:17:18 +02:00
parent c0ff849c0f
commit 632e25abe3
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['default_email_address'] = "";
$config['default_cc_address'] = '';
$config['default_sender_name'] = "";
$config['default_sender_address'] = "";
$config['default_bounce_address'] = "";
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['wordwrap'] = FALSE;

View File

@@ -0,0 +1,35 @@
<?php
class MY_Email extends CI_Email {
var $default_cc_address = "";
var $default_email_address = "";
var $default_sender_name = "";
var $default_sender_address = "";
var $default_bounce_address = "";
function __construct($config = array())
{
parent::__construct($config);
}
function send_mail($subject, $body, $to = NULL, $reply_name = NULL, $reply_mail = NULL, $attachment = NULL) {
$this->reply_to($reply_mail, $reply_name);
$this->from($this->default_sender_address, $this->default_sender_name, $this->default_bounce_address);
$this->set_mailtype('html');
$this->subject($subject);
$this->message($body);
if ($to == NULL) {
$to = $this->default_email_address;
$this->cc($this->default_cc_address);
}
if ($attachment) {
$this->attach($attachment);
}
$this->to($to);
return $this->send();
}
}
?>