mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-12 06:56:24 +00:00
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:
parent
70ae66edf7
commit
1186bc56f1
1 changed files with 20 additions and 3 deletions
|
@ -157,6 +157,18 @@ class EmailComponent extends Object{
|
||||||
*/
|
*/
|
||||||
var $lineLength = 70;
|
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
|
* @deprecated see lineLength
|
||||||
*/
|
*/
|
||||||
|
@ -804,8 +816,13 @@ class EmailComponent extends Object{
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _mail() {
|
function _mail() {
|
||||||
$header = implode("\r\n", $this->__header);
|
if ($this->lineFeed === null) {
|
||||||
$message = implode("\r\n", $this->__message);
|
$lineFeed = PHP_EOL;
|
||||||
|
} else {
|
||||||
|
$lineFeed = $this->lineFeed;
|
||||||
|
}
|
||||||
|
$header = implode($lineFeed, $this->__header);
|
||||||
|
$message = implode($lineFeed, $this->__message);
|
||||||
if (is_array($this->to)) {
|
if (is_array($this->to)) {
|
||||||
$to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
|
$to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue