Adding EmailCompnent::lineFeed property toallow overriding the default line feed string when using mail() function to send mail. Closes #1320

This commit is contained in:
ADmad 2010-11-27 02:11:43 +05:30
parent 70ae66edf7
commit 1186bc56f1

View file

@ -98,7 +98,7 @@ class EmailComponent extends Object{
var $bcc = array();
/**
* The date to put in the Date: header. This should be a date
* The date to put in the Date: header. This should be a date
* conformant with the RFC2822 standard. Leave null, to have
* today's date generated.
*
@ -157,6 +157,18 @@ class EmailComponent extends Object{
*/
var $lineLength = 70;
/**
* Line feed character(s) to be used when sending using mail() function
* If null PHP_EOL is used.
* RFC2822 requires it to be CRLF but some Unix
* mail transfer agents replace LF by CRLF automatically
* (which leads to doubling CR if CRLF is used).
*
* @var string
* @access public
*/
var $lineFeed = null;
/**
* @deprecated see lineLength
*/
@ -804,8 +816,13 @@ class EmailComponent extends Object{
* @access private
*/
function _mail() {
$header = implode("\r\n", $this->__header);
$message = implode("\r\n", $this->__message);
if ($this->lineFeed === null) {
$lineFeed = PHP_EOL;
} else {
$lineFeed = $this->lineFeed;
}
$header = implode($lineFeed, $this->__header);
$message = implode($lineFeed, $this->__message);
if (is_array($this->to)) {
$to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {