Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
3fdd3203
Commit
3fdd3203
authored
Mar 15, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил Reply-to заголовок в сообщение об опечатке
parent
4a8bbcb9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
constants.php
constants.php
+2
-0
functions.php
functions.php
+2
-1
server.php
server.php
+3
-1
No files found.
constants.php
View file @
3fdd3203
...
...
@@ -3,6 +3,8 @@
// Почтовый ящик отправителя писем
const
EMAIL
=
"typos@etersoft.ru"
;
const
REPLY_TO
=
"noreply+typos@etersoft.ru"
;
// Минимальная задержка между запросами одного пользователя
const
MIN_TIME
=
60
;
...
...
functions.php
View file @
3fdd3203
...
...
@@ -11,7 +11,7 @@
*************************************/
/*Отправка 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
.=
"MIME-Version: 1.0
\r\n
"
;
$headers
.=
"Return-path: <"
.
$from_email
.
">
\r\n
"
;
...
...
@@ -21,6 +21,7 @@ function sendMail($subject,$body, $to, $from_email, $from_name, $type = 'plain')
$headers
.=
"X-MSMail-Priority: Normal
\r\n
"
;
$headers
.=
"X-Mailer: Automatic PHP Script
\r\n
"
;
$headers
.=
"From:"
.
$from_name
.
"<"
.
$from_email
.
">
\r\n
"
;
$headers
.=
"Reply-To:
$reply_to
\r\n
"
;
if
(
mail
(
$to
,
$subject
,
$body
,
$headers
))
{
return
true
;
...
...
server.php
View file @
3fdd3203
...
...
@@ -144,7 +144,9 @@ if ($email_users) {
$from_email
=
EMAIL
;
$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'
]));
return
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment