-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenviar.php
More file actions
22 lines (18 loc) · 795 Bytes
/
Copy pathenviar.php
File metadata and controls
22 lines (18 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$para= "projetoeuconto@gmail.com";
$assunto= "Contato pelo site";
$nome= $_REQUEST['nome'];
$email= $_REQUEST['email'];
$mensagem= str_replace("\n","<br/>",$_REQUEST['mensagem']);
$message = "<strong>Nome: </strong> $nome";
$message.= "<br/><br/><strong>Email: </strong> $email";
$message.= "<br/><br/><strong>Mensagem: </strong> $mensagem";
$headers = "Content-Type: text/html; charset= utf-8\n";
$headers .= "From: $nome\n";
if(mail ( $para , $assunto , $message , $headers )){
echo "<script>alert('Mensagem enviada com sucesso! Agradecemos pelo contato.'); window.location= 'index.php'; </script>";
}
else{
echo "<script>alert('Erro! Mensagem não enviada.'); window.location= 'index.php'; </script>";
}
?>