Email Attatchments

Discussion in 'PHP' started by baddot, Dec 5, 2006.

  1. #1
    Anyone can guide me on this script ? i have this script made but when i send out the mail it wont show the pictures can i know where went wrong ?

    <?php
    //add From: header
    $headers = "From: eugene@baddot.com\r\n";
    
    //specify MIME version 1.0
    $headers .= "MIME-Version: 1.0\r\n";
    
    //unique boundary
    $boundary = uniqid("HTMLDEMO");
    
    //tell e-mail client this e-mail contains//alternate versions
    $headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";
    
    //plain text version of message
    $body = "--$boundary\r\n" .
       "Content-Type: text/plain; charset=ISO-8859-1\r\n" .
       "Content-Transfer-Encoding: base64\r\n\r\n";
    $body .= chunk_split(base64_encode("This is the plain text version!"));
    
    //HTML version of message
    $body .= "--$boundary\r\n" .
       "Content-Type: text/html; charset=ISO-8859-1\r\n" .
       "Content-Transfer-Encoding: base64\r\n\r\n";
    $body .= chunk_split(base64_encode("This the <b>HTML</b> version! <img src=\"http://www.baddot.com/images/d2bd75.jpg\" border=\"0\" hspace=0 align=baseline>"));
    
    //send message
    mail("eugene@rach.com.sg", "An HTML Message", $body, $headers);
    ?> 
    PHP:
     
    baddot, Dec 5, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Dec 5, 2006 IP
  3. PinotNoir

    PinotNoir Peon

    Messages:
    505
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
  4. baddot

    baddot Active Member

    Messages:
    309
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #4
    i tried the php mailer but i have the same problem too when i recieve the mail on testing...and if im blocking the picture why i can see pictures where people send me vaigra pictures in it hmmm strange
     
    baddot, Dec 5, 2006 IP