-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontact.php
More file actions
31 lines (25 loc) · 967 Bytes
/
Copy pathcontact.php
File metadata and controls
31 lines (25 loc) · 967 Bytes
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
<?php
if(isset($_POST['contact-email']) && !empty($_POST['contact-email'])){
$nome = addslashes($_POST['contact-name']);
$email = addslashes($_POST['contact-email']);
$phone = addslashes($_POST['contact-phone']);
$mensagem = addslashes($_POST['contact-message']);
$to = "atendimento@indexdc.com.br";
$subject = "Novo Contato no site Index DC";
$body = "Nome: ".$nome."\n".
"Telefone: ".$phone."\n".
"Email: ".$email. "\n".
"Mensagem: ".$mensagem;
$header = "From: atendimento@indexdc.com.br"."\r\n"
."Reply-To:".$email."\r\n"
."X-Mailer:PHP/".phpversion();
if(mail($to,$subject,$body,$header)){
// echo ('<script type="text/javascript"> alert("Mensagem enviada, entraremos em contato em breve!"); </script>');
return true;
}else{
// echo ('<script type="text/javascript"> alert("Algo deu errado, tente novamente!"); </script>');
return false;
}
header('location: /');
}
?>