Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if((isset($_POST['email']) && strlen($_POST['email']) > 0)){
  5.  
  6. $nome = addslashes($_POST['name']);
  7. $telefone = addslashes($_POST['telefone']);
  8. $email = addslashes($_POST['email']);
  9. $mensagem = addslashes($_POST['message']);
  10.  
  11. $to = "email@gmail.com";
  12. $subject = "Contato - Site";
  13.  
  14.  
  15.  
  16. $body .= "
  17. Nome: $nome
  18. E-mail: $email
  19. Telefone: $telefone
  20. Mensagem: $mensagem";
  21.  
  22.  
  23. $header = "From:email@gmail.com"."rn".
  24. "Reply-To:".$email."rn".
  25. "X=Mailer:PHP/".phpversion();
  26.  
  27. if (mail($to,$subject,$body,$header)) {
  28.  
  29. echo("Email enviado com sucesso!");
  30.  
  31. }else{
  32. echo("O email não pode ser enviado");
  33. }
  34.  
  35. }
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement