-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
48 lines (41 loc) · 1.34 KB
/
action.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
<?php
$nome = filter_input(INPUT_POST,'name',FILTER_SANITIZE_STRING);
$mail = filter_input(INPUT_POST,'mail', FILTER_SANITIZE_EMAIL);
$tele = filter_input(INPUT_POST,'tel', FILTER_SANITIZE_STRING);
$msgs = filter_input(INPUT_POST,'msg', FILTER_SANITIZE_STRING);
$acts = filter_input(INPUT_POST,'action', FILTER_SANITIZE_STRING);
$to = "contato@serralheriamancini.com.br";
$headers = "From: " . $mail . "\r\n";
$headers .= "Reply-To: ". $mail . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
if($acts == "contato") {
$subject = "Novo Contato de";
$subject .= $nome;
$tipo_os = "contato";
}
if($acts == "orcamento") {
$subject = "Novo Pedido de";
$subject .= $nome;
$tipo_os = "orçamento";
}
$mensage = "<html>";
$mensage .= "<body>";
$mensage .= "Olá, Você recebeu um novo";
$mensage .= $tipo_os;
$mensage .= ".<br>";
$mensage .= "<b>Nome do Cliente:</b>";
$mensage .= $nome;
$mensage .= "<br>";
$mensage .= "<b>Telefone de Contato:</b>";
$mensage .= $tele;
$mensage .= "<br>";
$mensage .= "<b>Email de Contato:</b>";
$mensage .= $mail;
$mensage .= "<br>";
$mensage .= "<b>Mensagem do Cliente:</b>";
$mensage .= $msgs;
$mensage .= "<br>";
$mensage .= "</body></html>";
mail($to, $subject, $mensage, $headers);
echo "<script>history.go(-1);</script>";