Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with HTML Email

    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.

    PHP Code:
    <?php       
           $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.="</head><body>";
           
    $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"); 
           
    pclose($fd);
    ?>
    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.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Never Mind. Our Mail Server was experiencing problems.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •