Hi,
This is the code I am using:
<?php
include ‘../php/Mail.php’;
include ‘../php/Mail/mime.php’ ;
$message = new Mail_mime();
// $text = file_get_contents(“mail_text.txt”);
$html = file_get_contents(“mail_html.html”);
// $message->setTXTBody($text);
$message->setHTMLBody($html);
$body = $message->get();
$extraheaders = array(“From”=>”
$headers = $message->headers($extraheaders);
$mail = Mail::factory(“mail”);
$mail->send(“[email protected]”, $headers, $body);
?>
This is the mail_html.html code:
<html>
<body bgcolor=”#00FF00″>
<table bgcolor=”#FF0000″ border=”1″><tr>
<td>Pretty Polly</td>
<td><img src=”img1.jpg” /></td>
</tr></table>
</body>
</html>
If you run it:
The email reaches its destination
The problem is that mail_html.html contains an image while the email received does not. Also the body bgcolor stays white in the email. The table though does change color.
The two paths to the include files are correct.