Skip to content

Instantly share code, notes, and snippets.

Created August 6, 2011 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1129748 to your computer and use it in GitHub Desktop.
Save anonymous/1129748 to your computer and use it in GitHub Desktop.
<?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 <contato@2face.com.br>\r\n";
$headers.= "Content-Type: text/html; charset=ISO-8859-1 ";
$headers.= "MIME-Version: 1.0 ";
if (mail('contato@2face.com.br', $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