protected function getAttachmentsArray($message)
    {
        $attachments = array();

        foreach ($message->getChildren() as $entity) {
            if ($entity instanceof Swift_Attachment) {
                $attachments[] = array(
                    'name' => $entity->getFilename(),
                    'data' => $entity->getBody(),
                    'content_id' => "<{$entity->getContentType()}>"
                );
            }
        }

        return $attachments;
    }
protected function getAttachmentsArray($message)
    {
        $attachments = array();

        foreach ($message->getChildren() as $entity) {
            if ($entity instanceof Swift_Attachment) {
                $attachments[] = array(
                    'name' => $entity->getFilename(),
                    'data' => $entity->getBody(),
                    'content_id' => "<{$entity->getContentType()}>"
                );
            }
        }

        return $attachments;
    }
protected function getAttachmentsArray ( $ message ) { $ attachments = array ( ) ; foreach ( $ message -> getChildren ( ) as $ entity ) { if ( $ entity instanceof Swift_Attachment ) { $ attachments [ ] = array ( 'name' => $ entity -> getFilename ( ) , 'data' => $ entity -> getBody ( ) , 'content_id' => "<{$entity->getContentType()}>" ) ; } } return $ attachments ; }
Returns an array of attachments extracted from
a given mail message.

@param $message

@return array
Returns an array of attachments extracted from a given mail message .