src/bundles/Mail/PHPMailer/class.phpmailer.php
public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
    {
        try {
            if (!@is_file($path)) {
                throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
            }

            // If a MIME type is not specified, try to work it out from the file name
            if ($type == '') {
                $type = self::filenameToType($path);
            }

            $filename = basename($path);
            if ($name == '') {
                $name = $filename;
            }

            $this->attachment[] = array(
                0 => $path,
                1 => $filename,
                2 => $name,
                3 => $encoding,
                4 => $type,
                5 => false, // isStringAttachment
                6 => $disposition,
                7 => 0
            );

        } catch (phpmailerException $exc) {
            $this->setError($exc->getMessage());
            $this->edebug($exc->getMessage());
            if ($this->exceptions) {
                throw $exc;
            }
            return false;
        }
        return true;
    }
public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
    {
        try {
            if (!@is_file($path)) {
                throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
            }

            // If a MIME type is not specified, try to work it out from the file name
            if ($type == '') {
                $type = self::filenameToType($path);
            }

            $filename = basename($path);
            if ($name == '') {
                $name = $filename;
            }

            $this->attachment[] = array(
                0 => $path,
                1 => $filename,
                2 => $name,
                3 => $encoding,
                4 => $type,
                5 => false, // isStringAttachment
                6 => $disposition,
                7 => 0
            );

        } catch (phpmailerException $exc) {
            $this->setError($exc->getMessage());
            $this->edebug($exc->getMessage());
            if ($this->exceptions) {
                throw $exc;
            }
            return false;
        }
        return true;
    }
public function addAttachment ( $ path , $ name = '' , $ encoding = 'base64' , $ type = '' , $ disposition = 'attachment' ) { try { if ( ! @ is_file ( $ path ) ) { throw new phpmailerException ( $ this -> lang ( 'file_access' ) . $ path , self :: STOP_CONTINUE ) ; } // If a MIME type is not specified, try to work it out from the file name if ( $ type == '' ) { $ type = self :: filenameToType ( $ path ) ; } $ filename = basename ( $ path ) ; if ( $ name == '' ) { $ name = $ filename ; } $ this -> attachment [ ] = array ( 0 => $ path , 1 => $ filename , 2 => $ name , 3 => $ encoding , 4 => $ type , 5 => false , // isStringAttachment 6 => $ disposition , 7 => 0 ) ; } catch ( phpmailerException $ exc ) { $ this -> setError ( $ exc -> getMessage ( ) ) ; $ this -> edebug ( $ exc -> getMessage ( ) ) ; if ( $ this -> exceptions ) { throw $ exc ; } return false ; } return true ; }
Add an attachment from a path on the filesystem.
Returns false if the file could not be found or read.
@param string $path Path to the attachment.
@param string $name Overrides the attachment name.
@param string $encoding File encoding (see $Encoding).
@param string $type File extension (MIME) type.
@param string $disposition Disposition to use
@throws phpmailerException
@return boolean
Add an attachment from a path on the filesystem . Returns false if the file could not be found or read .