public function prepareAttachment($attachment)
    {
        if ($this->isFile($attachment) !== true) {
            return false;
        }
        //http://php.net/manual/en/class.finfo.php
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
        $fileType = $fileInfo->file($attachment);
        $file = fopen($attachment, 'r');
        $fileContent = fread($file, filesize($attachment));
        $fileContent = chunk_split(base64_encode($fileContent));
        fclose($file);
        $msgContent = 'Content-Type: '.$fileType.'; name='.basename($attachment)."\r\n";
        $msgContent .= 'Content-Transfer-Encoding: base64'."\r\n";
        $msgContent .= 'Content-ID: <'.basename($attachment).'>'."\r\n";
        $msgContent .= "\r\n".$fileContent."\r\n\r\n";

        return $msgContent;
    }
public function prepareAttachment($attachment)
    {
        if ($this->isFile($attachment) !== true) {
            return false;
        }
        //http://php.net/manual/en/class.finfo.php
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
        $fileType = $fileInfo->file($attachment);
        $file = fopen($attachment, 'r');
        $fileContent = fread($file, filesize($attachment));
        $fileContent = chunk_split(base64_encode($fileContent));
        fclose($file);
        $msgContent = 'Content-Type: '.$fileType.'; name='.basename($attachment)."\r\n";
        $msgContent .= 'Content-Transfer-Encoding: base64'."\r\n";
        $msgContent .= 'Content-ID: <'.basename($attachment).'>'."\r\n";
        $msgContent .= "\r\n".$fileContent."\r\n\r\n";

        return $msgContent;
    }
public function prepareAttachment ( $ attachment ) { if ( $ this -> isFile ( $ attachment ) !== true ) { return false ; } //http://php.net/manual/en/class.finfo.php $ fileInfo = new \ finfo ( FILEINFO_MIME_TYPE ) ; $ fileType = $ fileInfo -> file ( $ attachment ) ; $ file = fopen ( $ attachment , 'r' ) ; $ fileContent = fread ( $ file , filesize ( $ attachment ) ) ; $ fileContent = chunk_split ( base64_encode ( $ fileContent ) ) ; fclose ( $ file ) ; $ msgContent = 'Content-Type: ' . $ fileType . '; name=' . basename ( $ attachment ) . "\r\n" ; $ msgContent .= 'Content-Transfer-Encoding: base64' . "\r\n" ; $ msgContent .= 'Content-ID: <' . basename ( $ attachment ) . '>' . "\r\n" ; $ msgContent .= "\r\n" . $ fileContent . "\r\n\r\n" ; return $ msgContent ; }
For preparing an attachment to send with mail.

@since 1.9.0

@return mix-data
For preparing an attachment to send with mail .