send() com html
http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif Olá Pessoal!
Estou tentando enviar um e-mail com formatação html, mas não está dando certo!!!
Segue o código:
<?php
class sendMail {
var $POSTReturn;
var $POSTNumb;
var $MAILRemet = "cestari@cmilhasolteira.sp.gov.br";
var $MAILName = "Vereador Cestari";
var $MAILAss = "Novidades no Blog do Vereador Cestari";
var $MAILMsg;
//MONTA A MENSAGEM COM OS POSTS
function mountPosts($email,$id) {
$this->MAILMsg = "<html>\n";
$this->MAILMsg .= "<head>\n";
$this->MAILMsg .= "<meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\" />\n";
$this->MAILMsg .= "<style type=text/css>\n";
$this->MAILMsg .= "<!--\n";
$this->MAILMsg .= "body { background-color: #dbe4d9; }\n";
$this->MAILMsg .= "table { background-color: #FFF; border: 5px solid #FFF; }\n";
$this->MAILMsg .= "table tr td { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666; }\n";
$this->MAILMsg .= "td.myTitle,td.myText,td.myRodape { padding: 0 8px 0 8px; }\n";
$this->MAILMsg .= "hr { width: 786px; }\n";
$this->MAILMsg .= "td.myRodape { font-size: 9px; text-align: center; }\n";
$this->MAILMsg .= "a { color: #000; text-decoration: none;}\n";
$this->MAILMsg .= "a:hover { text-decoration: underline; }\n";
$this->MAILMsg .= "-->\n";
$this->MAILMsg .= "</style>\n";
$this->MAILMsg .= "</head>\n";
$this->MAILMsg .= "<body>\n";
$this->MAILMsg .= "<table width=800 border=0 align=center cellpadding=0 cellspacing=0>\n";
$this->MAILMsg .= "<tr><td><img src=\"[http://www.ilhasolteira.net/vereadorcestari/sys_imgs/myheader.jpg\"](http://www.ilhasolteira.net/vereadorcestari/sys_imgs/myheader.jpg%5C) /></td></tr>\n";
$this->MAILMsg .= "<tr height=8px><td></td></tr>\n";
while($myrow=mysql_fetch_array($this->POSTReturn)) {
$this->MAILMsg .= "<tr><td><tr><td class=myTitle><b>$myrow[myTitle]</b></td></tr>\n";
$this->MAILMsg .="<tr><td class=myText>$myrow[myText]</td></tr></td></tr>\n";
$this->MAILMsg .= "<tr height=20px><td><hr></td></tr>";
}
$this->MAILMsg .= "<tr><td class=myRodape>Caso não queira receber esse e-mail novamente, <a href=\"[http://www.ilhasolteira.net/vereadorcestari/admin/NLT/DELUser.php?email=$email&id=$id\">descadastre-se.O código retorna sucesso mas o e-mail não chega, nem na caixa de entrada, nem no lixo eletrônico e nem no span. Se altero na funcao send() a linha:
$msg = $this->MAILMsg;
para supondo: $msg = "testando o sistema";
o e-mail chega normalmente. Alguém saberia me dizer o que tem errado no código, mas precisamente na var $MAILMsg!!!Discussão (5)
Carregando comentários...