Currently I have a script that send some mail, the script result are a couple html tables:
$from = "prueba.com <[email protected]>";
$to = "[email protected]";
echo "<div>";
$contenido = ob_get_contents();
echo "</div>";
$cabeceras = "Content-type: text/html; charset=iso-8859-1 \r\n"
."MIME-Version: 1.0 \r\n"
."To: $cliente <$email> \r\n"
."From: prueba <[email protected]> \r\n";
mail($to,$subject,$contenido,$cabeceras);
ob_end_flush();
As might give css to that email? as I have tried several methods and none has worked.
Thanks in advance for your cooperation
EDIT:
THIS is my CODE http://www.mediafire.com/?bq9352xh6paji1d
Maybe you wanted like this: (using ob_get_clean())
ob_start();
echo "<div>";
// more html
echo "</div>";
$contenido = ob_get_clean();
and lose the last ob_end_flush();
TEST:
$from = "prueba.com <[email protected]>";
$to = "[email protected]";
ob_start();
echo "<div>";
echo "<table border='1'><tr><td>TEST</td></tr></tr>";
echo "</div>";
$contenido = ob_get_clean();
$cabeceras = "Content-type: text/html; charset=iso-8859-1 \r\n"
."MIME-Version: 1.0 \r\n"
."To: $cliente <$email> \r\n"
."From: prueba <[email protected]> \r\n";
mail($to,$subject,$contenido,$cabeceras);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With