diff --git a/mailer.php b/mailer.php index 851b43e..460c21c 100644 --- a/mailer.php +++ b/mailer.php @@ -12,8 +12,8 @@ * Christian Knuth * https://github.com/ikkez/F3-Sugar/ * - * @version 1.0.4 - * @date: 12.02.2019 + * @version 1.1.0 + * @date: 05.04.2019 */ class Mailer { @@ -51,8 +51,6 @@ public function initSMTP() { $f3->get('mailer.smtp.pw')); if (!$f3->devoid('mailer.errors_to',$errors_to)) $this->setErrors($errors_to); - if (!$f3->devoid('mailer.return_to',$return_to)) - $this->setReturn($return_to); if (!$f3->devoid('mailer.reply_to',$reply_to)) $this->setReply($reply_to); if (!$f3->devoid('mailer.from_mail',$from_mail)) { @@ -144,21 +142,12 @@ public function setReply($email, $title=null) { } /** - * set Errors-to field + * set receipient for bounce error mails * @param $email * @param null $title */ public function setErrors($email, $title=null) { - $this->set('Errors-to', $this->buildMail($email,$title)); - } - - /** - * set Return-Path field - * @param $email - * @param null $title - */ - public function setReturn($email, $title=null) { - $this->set('Return-Path', $this->buildMail($email,$title)); + $this->set('Sender', $this->buildMail($email,$title)); } /** diff --git a/mailer_config.sample.ini b/mailer_config.sample.ini index f282d06..b396bc9 100755 --- a/mailer_config.sample.ini +++ b/mailer_config.sample.ini @@ -1,5 +1,6 @@ [mailer] +; smtp config smtp.host = smtp.domain.com smtp.port = 25 smtp.user = username @@ -10,9 +11,10 @@ smtp.scheme = ; global mail settings from_mail = info@domain.de from_name = Web Application -errors_to = error@domain.com -return_to = bounce@domain.com -reply_to = answer@domain.com +; mail to receive bounced mails +errors_to = bounce@domain.com +; used mail for replies to the sent mail +reply_to = support@domain.com ; handler for SMTP errors on.failure = \MailTest::logError diff --git a/readme.md b/readme.md index 734e09d..284f0bf 100755 --- a/readme.md +++ b/readme.md @@ -25,13 +25,18 @@ smtp.pw = 123456789! smtp.scheme = ; optional mail settings -from_mail = info@domain.com +from_mail = noreply@domain.com from_name = Mario Bros. -errors_to = errors@domain.com -return_to = bounce@domain.com -reply_to = answer@domain.com +; mail to receive bounced mails +errors_to = bounce@domain.com +; used mail for replies to the sent mail +reply_to = info@domain.com + +; handler for SMTP errors on.failure = \Controller\Mail::logError +; handler for tracing opened mails on.ping = \Controller\Mail::traceMail +; handler for redirecting jump links on.jump = \Controller\Mail::traceClick ; automatically create jump links in all tags jumplinks = true