Guest User

Untitled

a guest
May 21st, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?
  2. $para = "seuemail@seudomino.com.br";
  3. $subject    = "Form de contato teste";
  4.  
  5.  
  6. $nome       = $_POST['nome'];
  7. $email      = $_POST['email'];
  8. $assunto        = $_POST['assunto'];
  9. $mensagem   = $_POST['mensagem'];
  10.  
  11. $replyto = $from = $email;
  12.  
  13.  
  14. // envia o email
  15.  
  16. $headers = "From: $from \n";
  17. $headers.= "Reply-to: $replyto\n";
  18. $headers.= "Return-Path: $replyto\n";
  19. $headers.= "X-Mailer: PHP Mail ver".phpversion()."\n"; // mailer
  20. $headers.= "Content-type:text/html \n\r";
  21.  
  22. $texto = "Nome: $nome <br>";
  23. $texto.= "E-mail: $email <br>";
  24. $texto.= "Assunto: $assunto <br>";
  25. $texto.= "Mensagem: $mensagem <br>";
  26.  
  27.  
  28.  
  29. if(!mail($para,$subject,$texto,$headers,"-f $from")){
  30.     die("erro ao enviar o email");
  31. }
  32.  
  33. ?>
  34.  
  35. seu email foi enviado com sucesso.
Add Comment
Please, Sign In to add comment