Skip to content

Instantly share code, notes, and snippets.

@jhowbhz
Last active July 7, 2018 00:43
Show Gist options
  • Save jhowbhz/c3be60b200ec3def0cad97ca6e8e0ba8 to your computer and use it in GitHub Desktop.
Save jhowbhz/c3be60b200ec3def0cad97ca6e8e0ba8 to your computer and use it in GitHub Desktop.
Enviar e-mail com mail()
<?php
if(isset($_POST ['nome']) && !empty($_POST ['nome'])){
$nome = addslashes(strip_tags($_POST['nome']));
$email = addslashes(strip_tags($_POST['email']));
$para = '[email protected]';
$assunto = 'Dados Página';
$corpo = "Nome: ".$nome."\r\n"."E-mail: ".$email;
$cabecalho = "From: [email protected]"."\r\n";
"Reply-to: ".$email."\r\n".
"X-Mailer: PHP/".phpversion();
$cabecalho = "MIME-Version: 1.0" . "\r\n";
$cabecalho .= "Content-type:text/html;charset=UTF-8" . "\r\n";
mail($para, $assunto, $corpo, $cabecalho);
$resposta = $email;
$titulo = 'email-titulo-aqui';
$texto = '<!DOCTYPE html>
<html>
<head>
<title>Titulo do email</title>
</head>
<body>
<p style="text-align:center">'.$nome.'</p>
</body>
</html>';
$cabeca = "From: [email protected]"."\r\n";
"Reply-to: ".$email."\r\n".
"X-Mailer: PHP/".phpversion();
mail($resposta, $titulo, $texto, $cabeca);
header("Location: https://go.hotmart.com/N8039457U?ap=b085");
}else{
echo "Campo vazio";
header("Location: index.php");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment