-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_email.php
42 lines (32 loc) · 1.1 KB
/
send_email.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
session_start();
$email = '[email protected]';
mb_language('japanese');
mb_internal_encoding('UTF-8');
$subject = 'nicodogoからのメッセージ';
function h($value){
return htmlspecialchars($value, ENT_QUOTES);
}
$name = h($_SESSION['mail']['name']);
$evaluation = h($_SESSION['mail']['evaluation']);
$message = h($_SESSION['mail']['comments']);
$body = '名前: '.$name.'<br>'.'メール: '.$evaluation.'<br>'.'メッセージ: '.$message;
$success = mb_send_mail($email, $subject, $body);
session_unset();
?>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="sent">
<?php if($success): ?>
<p>We will get back to you as soon as possible.</p>
<div><a href="reviews.php">Return to My Website</a></div>
<?php else: ?>
<p>I'm sorry, but the message didn't get sent correctly. Please fill out the form again.</p>
<div><a href="reviews.php">Return to My Website</a></div>
<?php endif; ?>
</div>
</body>
</html>