Hi, im having problems sending html emails with php (yes I know this is supposed to be easy). So using the code below the email sends but when I view the mail it has the html as plain text, im assuming this is mime-type stuff?
PHP:
<?php
require_once "Mail.php";
$from = "Them <testing@test.com>";
$to = "me@yahoo.com";
$subject = "Hi!";
$body = "<table border='0' cellspacing='0' cellpadding='0' width='666' align='center'>
<tbody>
<tr>
<td bgcolor='#b4afb4'>Hello world</td>
</tr>
</tbody>
</table>";
$host = "mail.mymailserver.com";
$username = "testing@test.com";
$password = "wicked";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$headers["MIME-Version"] = "MIME-Version: 1.0" . "\r\n";
$headers["Content-Type"] = "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>