Advertisement
Guest User

Untitled

a guest
Jul 14th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $assunto = $_POST["assunto"];
  2. $nome = $_POST["nome"];
  3. $email = $_POST["email"];
  4. $mensagem = $_POST["mensagem"];
  5.  
  6. $destino = "marcelo.soares@gmail.com";
  7.  
  8. $str = file_get_contents('template_mail_contato.php');
  9. $msg = $str;
  10. $msg = str_replace('[NOME]' , $nome , $msg);
  11. $msg = str_replace('[EMAIL]' , $email , $msg);
  12. $msg = str_replace('[MENSAGEM]' , $mensagem , $msg);
  13. $msg = str_replace('[ASSUNTO]' , $assunto , $msg);
  14.  
  15. $headers = "From: Site Digital Indoor <marcelo.soares@gmail.com>".PHP_EOL;
  16. $headers .= "Reply-To: ".$email.PHP_EOL;
  17. $headers .= "Bcc: raissaraahroo@gmail.com".PHP_EOL;
  18. $headers .= "MIME-Version: 1.0\r\n";
  19. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  20.  
  21. $subject = "Contato: ".$assunto;
  22. $mail = mail($destino, $subject, $msg, $headers);
  23.  
  24. if($mail) echo 'Mensagem enviada com sucesso.';
  25. else echo 'Ocorreu algum problema no envio da mensagem.';
  26.  
  27. echo $msg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement