View Full Version : Problem with HTML Email

10-22-2003, 05:35 PM
In the code below I am emailing an HTML email document that includes an image. When I use the image it will not email, but if I replace the <img> tag with text it does email it. This is done on a Linux 9.0 server using Sendmail. Sendmail is configured to use SMTP so that it uses our Company Mail Server. Could someone take a look at the code and see if there is something that I have coded wrong that would keep this from working when the image is used. Thank you.

$announce_from_email = "my@email.com";
$announce_to_email = "my@email.com";
$body="<html><head><title>Help Desk Survey Results</title>";
$body.="<style type='text/css'>\nBODY {background-color:#FFFFCC;font-family:Verdana;font-size:12;font-weight:bold}\nSPAN {color:blue;}\n</style>";
$body.="<br><br><center><img src='http://www.mysite.com/probtrack/butterfly2.gif'><center>";
$body.= "</body></html>";
$announce_subject = "testing image";
$MP = "/usr/sbin/sendmail -t";
$fd = popen($MP,"w");
fputs($fd, "To: $announce_to_email\r\n");
fputs($fd, "From: $announce_from_email\r\n");
fputs($fd, "Subject: $announce_subject\r\n");
fputs($fd, "X-Mailer: PHP4\n");
fputs($fd, "MIME-Version: 1.0\n");
fputs($fd, "Content-Type: text/html; charset=iso-8859-1\n");
fputs($fd, "Content-Transfer-Encoding: 8bit\n");
fputs($fd, $body . "\r\n");

I should also add that I checked with our Admin who supports our Mail server and we do not do any filtering to stop this type of email. Also the image is around 4000 bytes so the size should not be a problem.

10-22-2003, 08:54 PM
Never Mind. Our Mail Server was experiencing problems.