Last active
November 6, 2015 12:59
-
-
Save rafa-acioly/fff9daac489aebbfa0f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
$remetente = "[email protected]"; | |
$destinatario = "[email protected]"; | |
$nome = $_POST['nome']; | |
$empresa = $_POST['empresa']; | |
$email = $_POST['email']; | |
$telefone = $_POST['telefone']; | |
$assunto = $_POST['assunto']; | |
$mensagem = $_POST['mensagem']; | |
$corpo = ' | |
Nome: '.$nome.' | |
Empresa:: '.$empresa.' | |
Email: '.$email.' | |
Telefone: '.$telefone.' | |
Assunto: '.$assunto.' | |
Mensagem: '.$mensagem.''; | |
$headers = "MIME-Version: 1.1\n"; | |
$headers .= "Content-type: text/plain; charset=UTF-8\n"; | |
$headers .= "Content-Transfer-Encoding: 8bit\n"; | |
$headers .= "From: " . $remetente . "\r\n"; | |
$headers .= "Suporte \n"; | |
$headers .= "Responda para: " . $email . "\n"; | |
$headers .= "Return-Path: " . $remetente . "\n"; | |
$headers .= "<img src='' alt=''/>" | |
if (mail($destinatario, "Contato via formulario - site", $corpo, $headers, "-r" . $remetente)) { | |
echo "<script>alert('Enviado com sucesso!'); location.href='http://y.com.br/contato';</script>"; | |
} else { | |
echo "<script>alert('Ocorreu um Erro ao enviar a mensagem!');</script>"; | |
} | |
?> | |
<html lang="pt"> | |
<head> | |
<meta charset="utf-8" /> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment