protected $_basepart = false;
/**
+ * The charset to output the headers in.
+ *
+ * @var string
+ */
+ protected $_hdrCharset = null;
+
+ /**
* Function to run on serialize().
*/
public function __sleep()
}
/**
+ * Set the character set to use when outputting MIME headers.
+ *
+ * @param string $charset The character set.
+ */
+ public function setHeaderCharset($charset)
+ {
+ $this->_hdrCharset = $charset;
+ }
+
+ /**
+ * Get the character set to use when outputting MIME headers.
+ *
+ * @return string The character set.
+ */
+ public function getHeaderCharset()
+ {
+ return is_null($this->_hdrCharset)
+ ? $this->getCharset()
+ : $this->_hdrCharset;
+ }
+
+ /**
* Set the description of this part.
*
* @param string $description The description of this part.
if (!empty($this->_temp['toString'])) {
$hdr_ob->replaceHeader('Content-Transfer-Encoding', $this->_temp['toString']);
}
- array_unshift($parts, $hdr_ob->toString(array('charset' => $this->getCharset(), 'defserver' => $options['defserver'])));
+ array_unshift($parts, $hdr_ob->toString(array('charset' => $this->getHeaderCharset(), 'defserver' => $options['defserver'])));
}
$newfp = $this->_writeStream($parts);
}
}
- $result = $mailer->send(Horde_Mime::encodeAddress($email, $this->getCharset()), $headers->toArray(array('charset' => $this->getCharset())), $msg);
+ $result = $mailer->send(Horde_Mime::encodeAddress($email, $this->getCharset()), $headers->toArray(array('charset' => $this->getHeaderCharset())), $msg);
$this->_basepart = $old_basepart;
<api>alpha</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add 'raw' render view to Horde_Mime_Viewer.
+ <notes>* Request #8556: Allow specifying a header charset for a part.
+ * Add 'raw' render view to Horde_Mime_Viewer.
* Horde_Mime_Part::parseMessage() correctly parses non-MIME parts.
* Remove dependence on PEAR's Mail_mimeDecode::.
* Added Horde_Mime::uudecode().