diff --git a/application/helpers/hlp_sancho_helper.php b/application/helpers/hlp_sancho_helper.php index c788f1bbf..f063365ec 100644 --- a/application/helpers/hlp_sancho_helper.php +++ b/application/helpers/hlp_sancho_helper.php @@ -66,7 +66,7 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm $body = _parseMailContent('Sancho_Mail_Template', $layout); // Send mail - $ci->maillib->send('sancho@'. DOMAIN, $to, $subject, $body); + $ci->maillib->send('sancho@'. DOMAIN, $to, $subject, $body, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = true, $autogenerated = true); } /** diff --git a/application/libraries/MailLib.php b/application/libraries/MailLib.php index 0871273b5..6d0a48f73 100644 --- a/application/libraries/MailLib.php +++ b/application/libraries/MailLib.php @@ -19,7 +19,7 @@ class MailLib * Class constructor */ public function __construct() - { + { // Set the counter to 0 $this->sended = 0; @@ -46,7 +46,7 @@ class MailLib /** * Sends a single email */ - public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '') + public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = false, $autogenerated = false) { // If from is not specified then use the standard one if (is_null($from) || $from == '') @@ -90,6 +90,11 @@ class MailLib $this->ci->email->message($message); if (!isEmptyString($altMessage)) $this->ci->email->set_alt_message($altMessage); + if($bulk) + $this->ci->email->set_header('Precedence', 'bulk'); + if($autogenerated) + $this->ci->email->set_header('Auto-Submitted', 'auto-generated'); + // Avoid printing on standard output ugly error messages $result = @$this->ci->email->send();