Created
December 7, 2019 14:47
-
-
Save dnikonov/a9a0a2ab4b2496a89e3f887d8ef32458 to your computer and use it in GitHub Desktop.
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
//init.php | |
if (!function_exists('custom_mail') && COption::GetOptionString("webprostor.smtp", "USE_MODULE") == "Y") { | |
function custom_mail($to, $subject, $message, $additional_headers='', $additional_parameters=''){ | |
if (CModule::IncludeModule("webprostor.smtp")) { | |
// исправляю переносы строк в заголовках | |
if (!empty($additional_headers)) { | |
$additional_headers = str_replace("\r\n", "\n", $additional_headers); // на случай если уже нормальные переносы | |
$additional_headers = str_replace("\n", "\r\n", $additional_headers); | |
} | |
$smtp = new CWebprostorSmtp("s1"); | |
$result = $smtp->SendMail($to, $subject, $message, $additional_headers, $additional_parameters); | |
return $result ? true : false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment