I'm trying desperately to send an email via PHP, as per the code below. But the code breaks when I enter HTML, example:
$mensagem = "<html> (...) </html>";
I'll need a whole page in there! I've tried it too:
// Abre o template...
$corpoDoEmail = file_get_contents(index.txt');
//E troca as variáveis
$corpoDoEmail = str_replace( '%NOME%', $nome, $corpoDoEmail );
But it does not work, it does not bring any data.
<?php
$para = "[email protected]";
$nome = $_POST['nome'];
$assunto = "Ebah! Temos um novo usuário!";
$mensagem = "<strong>Nome: </strong>".$nome;
$mensagem .= "<br><br>O usuário: ".$_POST['nome'];
$mensagem .= " quer receber nosso e-mail de Bem Vindo!";
QUERO O CONTEÚDO HTML AQUI
$headers = "Content-Type:text/html; charset=UTF-8\n";
$headers .= "From: Golleo<[email protected]>\n";
$headers .= "X-Sender: <[email protected]>\n";
$headers .= "X-Mailer: PHP v".phpversion()."\n";
$headers .= "X-IP: ".$_SERVER['REMOTE_ADDR']."\n";
$headers .= "Return-Path: <[email protected]>\n";
$headers .= "MIME-Version: 1.0\n";
mail($para, $assunto, $mensagem,
$headers);
?>