From f7399350968e922497f2bf12e68173c111129a3a Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Wed, 6 Nov 2013 23:01:19 +0400 Subject: [PATCH] Add initialization of 'sendmail_from' PHP variable This is a workaround for some systems that requires this variable to be set explicitly for sending emails (thanks to falcon for the issue) --- src/mibew/libs/notify.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mibew/libs/notify.php b/src/mibew/libs/notify.php index cbd0d528..aa748998 100644 --- a/src/mibew/libs/notify.php +++ b/src/mibew/libs/notify.php @@ -28,7 +28,12 @@ function mibew_mail($toaddr, $reply_to, $subject, $body) $body = preg_replace("/\n/", "\r\n", $body); + $old_from = ini_get('sendmail_from'); + @ini_set('sendmail_from', $mibew_mailbox); @mail($toaddr, $real_subject, wordwrap(myiconv($mibew_encoding, $mail_encoding, $body), 70), $headers); + if (isset($old_from)) { + @ini_set('sendmail_from', $old_from); + } } ?> \ No newline at end of file