Tenho um sistema de news e estou usando nele o WYSIWYG para PHP.
Meu problema com ele é que quando mando por email o conteudo editado por ele ele substitui as " por \" fazendo com que as formataçoes, imagens, links não funcionem...
Agora se eu postar e mandar exibir com echo fica normal, entao acho que o problema nao é do WYSIWYG para PHP e sim no código que manda por email>
Envia.php
<?
//inclui a configuraçao do bd
include "includes/config.php";
set_time_limit (0);
// DADOS DO EMAIL
$assunto = $_POST['assunto'];
$mensagem = $_POST['mensagem'];
// É necessário indicar que o formato do e-mail é html
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $site <$email_site>\r\n";
// É necessário indicar que o formato do e-mail é html
$mensagem2 = "<html>
<head>
</head>
<body topmargin=0 leftmargin=0>
<table width=778 border=0 cellspacing=0 cellpadding=0>
<tr>
<td>$mensagem</td>
</tr>
</table>
</body>
</html>
";
// PEGANDO TODOS OS EMAILS
$Cons = mysql_query ("SELECT email FROM $tabela_emails") or die (mysql_error ());
if (mysql_num_rows ($Cons) == 0) {
echo "<script>
alert(\"Newsletter\\n \\nOcorreu um erro ao enviar a newsletter!\");
window.location = 'javascript:history.back(1)';
</script>";
} else {
while ($x = mysql_fetch_array ($Cons)) {
$e = mail ($x["email"], $assunto, $mensagem2, $headers);
echo "<script>
alert(\"Newsletter\\n \\nNewsletter enviada com sucesso!\");
window.location = 'index.php?area=Emails';
</script>";
}
}
?>
Agora vejam como fica quando chega em meu email:
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> <table width=778 border=0 cellspacing=0 cellpadding=0> <tr> <td><P><IMG alt=\"\" hspace=0 src=\"http://forum.wmonline.com.br/html/imagens/wm_01.gif\" align=baseline border=0></P></td> </tr> </table>
Ele some com as outras tags(html, head, body) e poe a barra: src=\"www.
O que pode ser isso?
Edição feita por: umbu, 21/10/2005, 11:02.










