Olá...
Estou com problemas no envio do meu formulário.
O e-mail é enviado corretamente só que a mensagem em vez de ir em html, está indo so o texto tipo:
<html> <head> <title></title> </head> <body> <p> <? echo "$nome"; ?> Edite aqui com o seu código</p> </body> </html>
Meu código parece estar tudo correto, segue abaixo:
<?php
include( '/home/vipagora/ultramail/ultramail.php' );
session_start("admin");
if($_SESSION["admin"] == "on"){
include("../config.php");
if ( isset( $_POST ) )
$postArray = &$_POST ; // 4.1.0 or later, use $_POST
else
$postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS
foreach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
else
$postedValue = htmlspecialchars( $value ) ;
}
$msg_para = $_POST["msg_para"];
$msg_assunto = $_POST["msg_assunto"];
$msg_tipo = $_POST["msg_tipo"];
$mensagem = $postedValue;
if($msg_para == "todos"){
$sql = mysql_query("SELECT * FROM n_emails WHERE ativo = 's'");
$total = mysql_num_rows($sql);
$mailok = 0;
$falha = 0;
while($lista = mysql_fetch_array($sql)){
$nome = $lista["nome"];
$email = $lista["email"];
$cabecalho = '';
$cabecalho .= "MIME-Version: 1.0\r\n";
$cabecalho .= "Content-type: text/html; charset=iso-8859-1\r\n";
$cabecalho .= "From: $a_nome <$a_email>";
$cabecalho .= "\nReply-To: $a_nome <$a_email>";
if(UltraMail($email,$msg_assunto,$mensagem, $cabecalho )){
$mailok = $mailok + 1;
$msg = "<font color=green>SUCESSO!</font>";
}
else{
$falha = $falha + 1;
$msg = "<font color=red>FALHA!</font>";
}
?>
<font face="Arial" size="2">Enviando para <b><?=$email?></b>...
<b><?=$msg?></b></font><br>
<?php } ?>
<script>alert("<?=$total?> e-mails deveriam ser enviados...\n<?=$mailok?> foram mandados corretamente,\n<?=$falha?> falharam!\n")</script>
<?php
}
else{
$cabecalho = '';
$cabecalho .= "MIME-Version: 1.0\r\n";
$cabecalho .= "Content-type: text/html; charset=iso-8859-1\r\n";
$cabecalho .= "From: $a_nome <$a_email>";
$cabecalho .= "\nReply-To: $a_nome <$a_email>";
if( UltraMail($msg_para,$msg_assunto,$mensagem, $cabecalho ) == TRUE ){
$msg = "<font color=green>SUCESSO!</font>";
}
else{
$msg = "<font color=red>FALHA!</font>";
}
?>
<font face="Arial" size="2">Enviando para <b><?=$msg_para?></b>...
<b><?=$msg?></b></font><br><?php
}
}
else{
echo "<script>location.href='login.php'</script>";
}
?>
<p><font face="Arial" size="2"><a href="index.php">Voltar</a></font></p>
<p align="right"><font size="1" face="Arial">Produzido por <a href="http://www.clenissonweb.kit.net" target="_blank">Clenisson
Calaça</a>.</font></p>
Aguardo um retorno, Abraço!
Olá amigo, tenta adicionar um cabecalho no envio do seu email. Ai os camando HTMl devem funcionar. Abaixo segue um exemplo simples :
$nome = $_POST['nome']; $fone = $_POST['fone']; $email = $_POST['email']; $ass = $_POST['ass']; $men = $_POST['men']; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; $headers .= "From: Texto <email@site.com.br>\n"; $headers .= "Return-Path: texto <contato@site.com.br>\n"; //envia email $mail_a = mail($email, "Titulo","Obrigado por entrar em contato conosco.<br><br> Em breve iremos entrar em contato. <br><br> www.teste.com.br",$headers);