01.
<?
02.
03.
$strTo
=
$_POST
[
"txtFormEmail"
];
04.
$strSubject
=
$_POST
[
"txtSubject"
];
05.
$strHeader
=
""
;
06.
$strHeader
=
"Content-type: text/html; charset=UTF-8\n"
;
07.
$strHeader
.=
"From: "
.
$_POST
[
"name"
].
"<"
.
$_POST
[
"txtTo"
].
">\nReply-To: "
.
$_POST
[
"txtTo"
].
""
;
08.
$strHeader
.=
"MIME-Version: 1.0\n"
;
09.
$strHeader
.=
"Content-type: text/html; charset=UTF-8\n"
;
10.
$strHeader
.=
"Content-Transfer-Encoding: 7bit\n\n"
;
11.
$name
=
$_SESSION
[
'name'
];
12.
$xx
=
$_SESSION
[
'xx'
];
13.
$email
=
$_SESSION
[
'email'
];
14.
15.
16.
17.
$strMessage
=
nl2br
(
$_POST
[
"txtDescription"
]);
18.
$strMessage
.=
nl2br
(
$strIso
);
19.
$strHeader
.=
"Content-type: text/html; charset=UTF-8\n"
;
20.
$strHeader
.=
"Content-Transfer-Encoding: 7bit\n\n"
;
21.
$flgSend
= mail(
$strTo
,
$strSubject
,
$strMessage
,
$strHeader
);
22.
23.
if
(
$flgSend
)
24.
{
25.
echo
"<script>alert('ระบบได้ส่งคำร้องการจัดทำเอกสารเรียบร้อย!!');</script>"
;
26.
echo
"<script>window.location='index.php';</script>"
;
27.
}
28.
else
29.
{
30.
echo
"<script>alert('เกิดข้อผิดพลาดในการส่งคำร้องขอ!!');</script>"
;
31.
echo
"<script>window.location='index.php';</script>"
;
32.
}
33.
34.
?>