More comment and hidden option to solve problems when sending emails.

This commit is contained in:
Laurent Destailleur 2016-12-19 01:04:17 +01:00
parent dbf96b8f59
commit 74e00c4d80
2 changed files with 8 additions and 3 deletions

View File

@ -143,6 +143,8 @@ class CMailFile
$this->msgishtml = $msgishtml; $this->msgishtml = $msgishtml;
} }
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
// Detect images // Detect images
if ($this->msgishtml) if ($this->msgishtml)
{ {
@ -822,8 +824,9 @@ class CMailFile
$strContent = preg_replace("/\r\n/si", "\n", $strContent); $strContent = preg_replace("/\r\n/si", "\n", $strContent);
} }
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged // Make RFC2045 Compliant, split lines
$strContent = rtrim(wordwrap($strContent)); //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
$strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content.
if ($this->msgishtml) if ($this->msgishtml)
{ {

View File

@ -1188,7 +1188,9 @@ class SMTPs
// Make RFC821 Compliant, replace bare linefeeds // Make RFC821 Compliant, replace bare linefeeds
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent); $strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // Make RFC2045 Compliant
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
$this->_msgContent[$strType] = array(); $this->_msgContent[$strType] = array();