-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
79 lines (72 loc) · 2.58 KB
/
mail.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
$email = $_POST["email"];
$headers = array();
$headers[] = 'From: Liddack Koding <[email protected]>';
$headers[] = 'X-Mailer: PHP/' . phpversion();
$headers[] = 'Reply-To: ' . $email;
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=utf-8';
$nome = $_POST["nome"];
$assunto = $_POST["assunto"];
$subj = '=?UTF-8?B?'.base64_encode("Formulário de Contato Koding - $nome").'?=';
$msg = $_POST["msg"];
$msg = "
<html>
<head>
<style type='text/css'>
body {
font-family: sans-serif;
}
#title {
text-align: center;
margin-top: 23px;
}
#content {
border-top: 2px solid rgb(140, 140, 140);
padding-top: 27px;
}
.campos span {
font-weight: bold;
margin-bottom: 7px;
}
.campos div {
margin-top: 7px;
margin-bottom: 21px;
word-wrap: break-word;
}
.campos {
margin: 0px 55px;
}
</style>
</head>
<body>
<div id='title'><center><h2>Formulário de Contato</h2></center></div>
<div id='content'>
<div class='campos'>
<span>Nome:</span>
<div>$nome</div>
</div>
<div class='campos'>
<span>Email:</span>
<div>
<a href='mailto:$email'>$email</a>
</div>
</div>
<div class='campos'>
<span>Assunto:</span>
<div>$assunto</div>
</div>
<div class='campos'>
<span>Mensagem:</span>
<div>$msg</div>
</div>
</div>
</body>
</html>
";
if (mail('[email protected]', $subj, $msg, implode("\r\n", $headers))) {
echo "A mensagem foi enviada!";
} else {
echo "Ocorreu um erro no envio.";
}
?>