Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $assunto = $_POST["assunto"];
- $nome = $_POST["nome"];
- $email = $_POST["email"];
- $mensagem = $_POST["mensagem"];
- $destino = "marcelo.soares@gmail.com";
- $str = file_get_contents('template_mail_contato.php');
- $msg = $str;
- $msg = str_replace('[NOME]' , $nome , $msg);
- $msg = str_replace('[EMAIL]' , $email , $msg);
- $msg = str_replace('[MENSAGEM]' , $mensagem , $msg);
- $msg = str_replace('[ASSUNTO]' , $assunto , $msg);
- $headers = "From: Site Digital Indoor <marcelo.soares@gmail.com>".PHP_EOL;
- $headers .= "Reply-To: ".$email.PHP_EOL;
- $headers .= "Bcc: raissaraahroo@gmail.com".PHP_EOL;
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
- $subject = "Contato: ".$assunto;
- $mail = mail($destino, $subject, $msg, $headers);
- if($mail) echo 'Mensagem enviada com sucesso.';
- else echo 'Ocorreu algum problema no envio da mensagem.';
- echo $msg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement