/** * Adds a message header. * * @param string $header The header name. * @param string $value The header value. * @param boolean $overwrite If true, an existing header of the same name * is being overwritten; if false, multiple * headers are added; if null, the correct * behaviour is automatically chosen depending * on the header name. * * @throws Horde_Mime_Exception */ public function addHeader($header, $value, $overwrite = null) { $lc_header = Horde_String::lower($header); if (is_null($overwrite) && in_array($lc_header, $this->_headers->singleFields(true))) { $overwrite = true; } if ($overwrite) { $this->_headers->removeHeader($header); } if ($lc_header === 'bcc') { $this->_bcc = $value; } else { $this->_headers->addHeader($header, $value); } }