diff options
author | Dominik Eckelmann <deckelmann@gmail.com> | 2012-11-23 18:48:09 +0100 |
---|---|---|
committer | Dominik Eckelmann <deckelmann@gmail.com> | 2012-11-23 18:48:09 +0100 |
commit | 1f61f312a78e212aaa4a4bc3f60961036ec07fd7 (patch) | |
tree | 765327c215ad3871dca18c8720beb27f9fcda056 /inc | |
parent | 78f0e83246184ff6cb8679d086b0fa17ab508057 (diff) | |
download | rpg-1f61f312a78e212aaa4a4bc3f60961036ec07fd7.tar.gz rpg-1f61f312a78e212aaa4a4bc3f60961036ec07fd7.tar.bz2 |
remove empty BCC/CC mail headers
Empty BCC/CC headers may cause errors on IIS.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/Mailer.class.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index cbd1eb0a9..256a76d22 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -553,6 +553,7 @@ class Mailer { * @returns string the headers */ protected function prepareHeaders() { + $this->removeEmptyBccOrCcHeader(); $headers = ''; foreach($this->headers as $key => $val) { $headers .= "$key: $val".MAILHEADER_EOL; @@ -561,6 +562,16 @@ class Mailer { } /** + * Removes empty BCC and CC Header. + * + * Empty BCC/CC Header can cause an error with Microsoft IIS. + */ + protected function removeEmptyBccOrCcHeader() { + if (isset($this->headers['Bcc']) && empty($this->headers['Bcc'])) unset($this->headers['Bcc']); + if (isset($this->headers['Cc']) && empty($this->headers['Cc'])) unset($this->headers['Cc']); + } + + /** * return a full email with all headers * * This is mainly intended for debugging and testing but could also be |