Sending MAIL WITH IMAGES!
Posted: Mon Nov 02, 2009 9:31 am
Does anybody know any tutorial or anything about sending images, not as an attachment but as background to a mail?
I have this code, It send the message but not the image, weird as it is, it worked and then didn't work. It seems pretty simple, but it's not. Hope anybody could help.

I have this code, It send the message but not the image, weird as it is, it worked and then didn't work. It seems pretty simple, but it's not. Hope anybody could help.
Code: Select all
<?php
$to = "your@email.com";
$subject = "Test ";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$from = "Your name<new@noreplay.com>";
$headers .= "From: {$from}";
$body = "
<html>
<head>
<title>Test HTML Mail</title>
</head>
<body >
<font color='blue'>This is an html Mail</font>
<table border='0' width = '461' height ='160' bgcolor='gray' align='center' background='http://www.domain.com/image.jpg'>
<tr>
<td><img src='http://www.domain.com/image2.jpg'></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
";
mail($to, $subject, $body, $headers);
?>