Created
August 6, 2011 21:12
-
-
Save anonymous/1129748 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
foreach ($_POST as $campo => $valor) { $$campo = $valor;} | |
$subject = "Contato"; | |
$html = " | |
<html> | |
<body> | |
<table width=400 border=0> | |
<tr> | |
<td width=100>Nome</td> | |
<td width=300>$nome</td> | |
</tr> | |
<tr> | |
<td>Cidade</td> | |
<td>$cidade</td> | |
</tr> | |
<tr> | |
<td>Estado</td> | |
<td>$estado</td> | |
</tr> | |
<tr> | |
<td>E-mail</td> | |
<td>$email</td> | |
</tr> | |
<tr> | |
<td>Telefone</td> | |
<td>$telefone</td> | |
</tr> | |
<tr> | |
<td>Mensagem</td> | |
<td>$mensagem</td> | |
</tr> | |
</table> | |
</body> | |
</html>"; | |
$headers = "From: Contato Site <[email protected]>\r\n"; | |
$headers.= "Content-Type: text/html; charset=ISO-8859-1 "; | |
$headers.= "MIME-Version: 1.0 "; | |
if (mail('[email protected]', $subject, $html, $headers)) { | |
echo "<script>window.alert('Formulario enviado com sucesso!'); </script>"; | |
echo "<script>window.location = 'index2.php';</script>"; | |
}else{ | |
echo "Ocorreu um erro durante o envio do email."; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment