Created
June 18, 2014 20:52
-
-
Save thulioph/e410c07bc0a93d6986d7 to your computer and use it in GitHub Desktop.
envio de formulario via php
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 | |
extract($_POST); | |
$mens = " | |
<b>Nome:</b> ".$nome."<br /><br /> | |
<b>Banco:</b> ".$banco."<br /><br /> | |
<b>Assunto:</b> ".$assunto."<br /><br /> | |
<b>CPF ou Contrato:</b> ".$cpf."<br /><br /> | |
<b>Telefone:</b> ".$telefone."<br /><br /> | |
<b>Email:</b> ".$email."<br /><br /> | |
<b>Mensagem:</b> ".$mensagem."<br /><br /> | |
"; | |
if (eregi('tempsite.ws$|locaweb.com.br$|hospedagemdesites.ws$|websiteseguro.com$', $_SERVER[HTTP_HOST])) { | |
$emailsender="email@dominio.com.br"; // Substitua essa linha pelo seu e-mail@seudominio | |
} else { | |
$emailsender = "email@dominio.com.br"; | |
} | |
if(PATH_SEPARATOR == ";") $quebra_linha = "\r\n"; //Se for Windows | |
else $quebra_linha = "\n"; //Se "não for Windows" | |
$cabecalho = "From: $nome <$emailsender> $quebra_linha"; | |
$cabecalho .= "Reply-To: $nome <$email> $quebra_linha"; | |
$cabecalho .= "MIME-Version: 1.0$quebra_linha"; | |
$cabecalho .= "Content-type: text/html; charset=iso-8859-1$quebra_linha"; | |
$envia = mail("email1@meudominio.com.br","Contato site",utf8_decode($mens),$cabecalho,"-r".$emailsender); | |
$envia .= mail("email2@meudominio.com.br","Contato site",utf8_decode($mens),$cabecalho,"-r".$emailsender); | |
if($envia){ | |
echo "Email enviado com sucesso!"; | |
}else{ | |
echo "Erro ao enviar email!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment