Hi,

I'm currently working on a script to take mail from a pop3 server.
Everything works correctly excepted to get back an attached file. In fact I can't find the name of attached file.

this is the code I have (directly inspired from doc):


echo $mail->countMessages() . " messages found\n";
       $i = 1;
foreach ($mail as $message) {
           echo "{$i} : Mail from '{$message->from}': {$message->subject}\n";
           $i++;
// dump all headers
           foreach ($message->getHeaders() as $name => $value) {
               if (is_string($value)) {
                   echo "$name: $value\n";
                   continue;
               }
               foreach ($value as $entry) {
                   echo "$name: $entry\n";
               }
           }
$part = $message; print_r($part);
           while ($part->isMultipart()) {
               $part = $message->getPart(2);
           }
           echo 'Type of this part is ' . strtok($part->contentType, ';') . 
"\n";
           echo "Content:\n";
           print_r($part->getContent());
       }



I can take the content of the attached part, but I can't find the NAME of this part...

Thanks,

Grooters Erwan

Reply via email to