-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<?php | ||
/** | ||
* modx ddTools class | ||
* @version 0.13 (2014-07-13) | ||
* @version 0.13.1 (2015-08-17) | ||
* | ||
* @uses modx 1.0.10 (Evo) | ||
* | ||
* @link http://code.divandesign.biz/modx/ddtools/0.13 | ||
* | ||
* @copyright 2014, DivanDesign | ||
* @copyright 2015, DivanDesign | ||
* http://www.DivanDesign.biz | ||
*/ | ||
|
||
|
@@ -1047,14 +1047,14 @@ public static function sendMail($to, $text, $from = '[email protected]', $sub | |
//Конвертируем тему в base64 | ||
$subject = "=?UTF-8?B?".base64_encode($subject)."?="; | ||
//Заголовки сообщения | ||
$headers = "From: $from\r\nMIME-Version: 1.0\r\n"; | ||
$headers = "From: ".$from.PHP_EOL."MIME-Version: 1.0".PHP_EOL; | ||
|
||
//Разделитель блоков в сообщении | ||
$bound = 'bound'.md5(time()); | ||
$multipart = "Content-Type: multipart/mixed; boundary = \"".$bound."\"\r\n\r\n--".$bound; | ||
$multipart = "Content-Type: multipart/mixed; boundary = \"".$bound."\"".PHP_EOL."--".$bound.PHP_EOL; | ||
|
||
//Добавлеям текст в сообщения | ||
$multipart .= "\r\nContent-Type: text/html; charset=UTF-8 \r\n\r\n".$text."\r\n\r\n--".$bound; | ||
$multipart .= "Content-Type: text/html; charset=UTF-8 ".PHP_EOL.trim($text, PHP_EOL).PHP_EOL."--".$bound; | ||
|
||
if(!empty($fileInputName)){ | ||
$attachFiles = array(); | ||
|
@@ -1088,16 +1088,16 @@ public static function sendMail($to, $text, $from = '[email protected]', $sub | |
//Перебираем присоединяемые файлы | ||
if(!empty($attachFiles)){ | ||
foreach($attachFiles as $name => $value){ | ||
$multipart .= "\r\n". | ||
'Content-Type: application/octet-stream; name = "=?UTF-8?B?'.base64_encode($name)."?=\"\r\n". | ||
"Content-Transfer-Encoding: base64\r\n\r\n". | ||
base64_encode($value)."\r\n\r\n--".$bound; | ||
$multipart .= PHP_EOL. | ||
'Content-Type: application/octet-stream; name = "=?UTF-8?B?'.base64_encode($name)."?=\"".PHP_EOL. | ||
"Content-Transfer-Encoding: base64".PHP_EOL. | ||
base64_encode($value).PHP_EOL."--".$bound; | ||
} | ||
} | ||
} | ||
|
||
//Добавляем разделитель окончания сообщения | ||
$headers .= $multipart."--\r\n"; | ||
$headers .= $multipart."--".PHP_EOL; | ||
|
||
$result = array(); | ||
|
||
|