Skip to content

Instantly share code, notes, and snippets.

@juarezpaf
Created September 26, 2009 01:48
Show Gist options
  • Select an option

  • Save juarezpaf/193975 to your computer and use it in GitHub Desktop.

Select an option

Save juarezpaf/193975 to your computer and use it in GitHub Desktop.
<?php
$EmailFrom = "imprensa@tendenciasemercado.com.br";
$EmailTo = trim(stripslashes($_POST['email']));
$assunto = "[tmnoticias] Contato realizado através do Midiakit";
$nome = trim(stripslashes($_POST['nome']));
$cargo = trim(stripslashes($_POST['cargo']));
$empresa = trim(stripslashes($_POST['empresa']));
$telefone = trim(stripslashes($_POST['telefone']));
$ramal = trim(stripslashes($_POST['ramal']));
$fax = trim(stripslashes($_POST['fax']));
$tipoContato = trim(stripslashes($_POST['tipoContato']));
$msg = "";
$msg .= "Nome: {$nome} \n";
$msg .= "Cargo: {$cargo} \n";
$msg .= "Empresa: {$empresa} \n";
$msg .= "Telefone: {$telefone} \n";
$msg .= "Ramal: {$ramal} \n";
$msg .= "Fax: {$fax} \n";
$msg .= "Tipo Contato: {$tipoContato} \n";
// enviando email
$success = mail($EmailTo, $assunto, $msg, "From: <$EmailFrom>");
// redirecionando para outra página
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=sucesso.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=erro.html\">";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment