Msl/ResourceProxy/Resource/Email/Message.php
public function moveToOutputFolder($outputFolder)
    {
        try {
            if ($this->message->isMultipart()) {
                // Getting the resource content (subject + body of the email)
                $contentPart = $this->message->getPart(1);
                $content = $contentPart->getContent();

                // Check for attachment
                // Getting second part of message object
                $part = $this->message->getPart(2);

                // Get the attachment file name
                if ($part->getHeaders()->has('Content-Disposition')) {
                    $fileName = $part->getHeaderField('Content-Disposition', 'filename');

                    // Get the attachment and decode
                    $attachment = base64_decode($part->getContent());

                    // Save the attachment
                    $attachmentFileName = $this->getAttachmentFileName($fileName, $outputFolder);
                    $finalAttOutputDirectory = $this->getAttachmentFileFolder($outputFolder);
                    if (!file_exists($finalAttOutputDirectory)) {
                        mkdir($finalAttOutputDirectory, 0775, true);
                    }
                    file_put_contents($attachmentFileName, $attachment);
                }
            } else {
                // Getting the resource content (subject + body of the email)
                $content = $this->message->getContent();
            }

            // Writing content to file
            // Setting the file name (output folder + message sub folder + current object string representation + timestamp)
            $outputFileName = $this->getContentFileName($outputFolder);
            // Writing the content to the output file
            $finalOutputDirectory = $this->getContentFileFolder($outputFolder);
            if (!file_exists($finalOutputDirectory)) {
                mkdir($finalOutputDirectory, 0775, true);
            }
            file_put_contents($outputFileName, $content);
        } catch (\Exception $e) {
            throw new Exception\ResourceMoveContentException(
                sprintf(
                    'Error while moving the content of resource \'%s\' to the output folder \'%s\'. Error message is: \'%s\'.',
                    $this->toString(),
                    $outputFolder,
                    $e->getMessage()
                )
            );
        }
        return true;
    }
public function moveToOutputFolder($outputFolder)
    {
        try {
            if ($this->message->isMultipart()) {
                // Getting the resource content (subject + body of the email)
                $contentPart = $this->message->getPart(1);
                $content = $contentPart->getContent();

                // Check for attachment
                // Getting second part of message object
                $part = $this->message->getPart(2);

                // Get the attachment file name
                if ($part->getHeaders()->has('Content-Disposition')) {
                    $fileName = $part->getHeaderField('Content-Disposition', 'filename');

                    // Get the attachment and decode
                    $attachment = base64_decode($part->getContent());

                    // Save the attachment
                    $attachmentFileName = $this->getAttachmentFileName($fileName, $outputFolder);
                    $finalAttOutputDirectory = $this->getAttachmentFileFolder($outputFolder);
                    if (!file_exists($finalAttOutputDirectory)) {
                        mkdir($finalAttOutputDirectory, 0775, true);
                    }
                    file_put_contents($attachmentFileName, $attachment);
                }
            } else {
                // Getting the resource content (subject + body of the email)
                $content = $this->message->getContent();
            }

            // Writing content to file
            // Setting the file name (output folder + message sub folder + current object string representation + timestamp)
            $outputFileName = $this->getContentFileName($outputFolder);
            // Writing the content to the output file
            $finalOutputDirectory = $this->getContentFileFolder($outputFolder);
            if (!file_exists($finalOutputDirectory)) {
                mkdir($finalOutputDirectory, 0775, true);
            }
            file_put_contents($outputFileName, $content);
        } catch (\Exception $e) {
            throw new Exception\ResourceMoveContentException(
                sprintf(
                    'Error while moving the content of resource \'%s\' to the output folder \'%s\'. Error message is: \'%s\'.',
                    $this->toString(),
                    $outputFolder,
                    $e->getMessage()
                )
            );
        }
        return true;
    }
public function moveToOutputFolder ( $ outputFolder ) { try { if ( $ this -> message -> isMultipart ( ) ) { // Getting the resource content (subject + body of the email) $ contentPart = $ this -> message -> getPart ( 1 ) ; $ content = $ contentPart -> getContent ( ) ; // Check for attachment // Getting second part of message object $ part = $ this -> message -> getPart ( 2 ) ; // Get the attachment file name if ( $ part -> getHeaders ( ) -> has ( 'Content-Disposition' ) ) { $ fileName = $ part -> getHeaderField ( 'Content-Disposition' , 'filename' ) ; // Get the attachment and decode $ attachment = base64_decode ( $ part -> getContent ( ) ) ; // Save the attachment $ attachmentFileName = $ this -> getAttachmentFileName ( $ fileName , $ outputFolder ) ; $ finalAttOutputDirectory = $ this -> getAttachmentFileFolder ( $ outputFolder ) ; if ( ! file_exists ( $ finalAttOutputDirectory ) ) { mkdir ( $ finalAttOutputDirectory , 0775 , true ) ; } file_put_contents ( $ attachmentFileName , $ attachment ) ; } } else { // Getting the resource content (subject + body of the email) $ content = $ this -> message -> getContent ( ) ; } // Writing content to file // Setting the file name (output folder + message sub folder + current object string representation + timestamp) $ outputFileName = $ this -> getContentFileName ( $ outputFolder ) ; // Writing the content to the output file $ finalOutputDirectory = $ this -> getContentFileFolder ( $ outputFolder ) ; if ( ! file_exists ( $ finalOutputDirectory ) ) { mkdir ( $ finalOutputDirectory , 0775 , true ) ; } file_put_contents ( $ outputFileName , $ content ) ; } catch ( \ Exception $ e ) { throw new Exception \ ResourceMoveContentException ( sprintf ( 'Error while moving the content of resource \'%s\' to the output folder \'%s\'. Error message is: \'%s\'.' , $ this -> toString ( ) , $ outputFolder , $ e -> getMessage ( ) ) ) ; } return true ; }
Saves the current resource to the given path. Returns true if move action was successful; false otherwise.

@param string $outputFolder the output folder path for this resource

@throws \Msl\ResourceProxy\Exception\ResourceMoveContentException

@return bool
Saves the current resource to the given path . Returns true if move action was successful ; false otherwise .