Not sure if it pass the first time : Help with imap attachment

From: Date: Tue, 01 Oct 2002 17:30:05 +0000
Subject: Not sure if it pass the first time : Help with imap attachment
Groups: php.general 
Request: Send a blank email to php-general+get-118493@lists.php.net to get a copy of this message
$attachdata[$x] = imap_base64($attachment); on that part sometimes the attachdata get empty so i did a IF but at that point i'm stuck. If i output it raw it will simply not work. Please help ! Here the code : if ($AsAttach == "Y") { for ($x=0;$x<sizeof($attachments);$x++) { $pid[$x] = $attachments[$x]["pid"]; $type[$x] = $attachments[$x]["type"]; echo "<br> PID : $pid[$x] <br> Type : $type[$x] <br>"; $attachment = quoted_printable_decode(imap_fetchbody($maillink, $z, $pid[$x])); $attach[$x] = $attachments[$x]["name"]; echo "Attach name : $attach[$x]"; $encoding[$x] = $sections[$x]["encoding"]; $attachdata[$x] = quoted_printable_decode($attachment); $attachdata[$x] = imap_base64($attachment); if ($attachdata[$x] == "") { $attachdata[$x] =$attachment; echo "<br>I'm in here !!!<br>"; } else { echo "<br>I didnt came in here !!!<br>"; } echo "<br>"; } } Btw the encoding are : 7bits, Base64 and quoted-printable Quoted-printable output correctly with the raw

« previous php.general (#118493) next »