Добавил Reply-to заголовок в сообщение об опечатке

parent 4a8bbcb9
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
// Почтовый ящик отправителя писем // Почтовый ящик отправителя писем
const EMAIL = "typos@etersoft.ru"; const EMAIL = "typos@etersoft.ru";
const REPLY_TO = "noreply+typos@etersoft.ru";
// Минимальная задержка между запросами одного пользователя // Минимальная задержка между запросами одного пользователя
const MIN_TIME = 60; const MIN_TIME = 60;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*************************************/ *************************************/
/*Отправка email-ов*/ /*Отправка email-ов*/
function sendMail($subject,$body, $to, $from_email, $from_name, $type = 'plain') { function sendMail($subject,$body, $to, $from_email, $from_name, $reply_to, $type = 'plain') {
$headers = "X-PHP-Script: ".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]." for ".$_SERVER['SERVER_ADDR']."\r\n"; $headers = "X-PHP-Script: ".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]." for ".$_SERVER['SERVER_ADDR']."\r\n";
$headers .= "MIME-Version: 1.0\r\n"; $headers .= "MIME-Version: 1.0\r\n";
$headers .= "Return-path: <".$from_email.">\r\n"; $headers .= "Return-path: <".$from_email.">\r\n";
...@@ -21,6 +21,7 @@ function sendMail($subject,$body, $to, $from_email, $from_name, $type = 'plain') ...@@ -21,6 +21,7 @@ function sendMail($subject,$body, $to, $from_email, $from_name, $type = 'plain')
$headers .= "X-MSMail-Priority: Normal\r\n"; $headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: Automatic PHP Script\r\n"; $headers .= "X-Mailer: Automatic PHP Script\r\n";
$headers .= "From:".$from_name."<".$from_email.">\r\n"; $headers .= "From:".$from_name."<".$from_email.">\r\n";
$headers .= "Reply-To: $reply_to\r\n";
if (mail($to, $subject, $body, $headers)) { if (mail($to, $subject, $body, $headers)) {
return true; return true;
......
...@@ -144,7 +144,9 @@ if ($email_users) { ...@@ -144,7 +144,9 @@ if ($email_users) {
$from_email = EMAIL; $from_email = EMAIL;
$from_name = '=?utf-8?B?' . base64_encode($_language[$code_language]['mail_from']) . '?='; $from_name = '=?utf-8?B?' . base64_encode($_language[$code_language]['mail_from']) . '?=';
if (sendMail($subject, $message_email, $to, $from_email, $from_name, 'html')) { $reply_to = REPLY_TO;
if (sendMail($subject, $message_email, $to, $from_email, $from_name, $reply_to, 'html')) {
echoJsonData(array('success' => 'true', 'message' => $_language[$code_language]['text_success'])); echoJsonData(array('success' => 'true', 'message' => $_language[$code_language]['text_success']));
return; return;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment