PHP Class PhpMimeMailParser\Attachment

Fully Tested Mailparse Extension Wrapper for PHP 5.4+
Mostra file Open project: exorus/php-mime-mail-parser

Protected Properties

Property Type Description
$content string File Content
$contentDisposition string Content-Disposition (attachment or inline)
$contentId string Content-ID
$contentType string Mime Type
$filename string Filename
$headers array An Array of the attachment headers
$mimePartStr string
$stream resource

Public Methods

Method Description
__construct ( string $filename, string $contentType, resource $stream, string $contentDisposition = 'attachment', string $contentId = '', array $headers = [], string $mimePartStr = '' ) Attachment constructor.
getContent ( ) : string Retrieve the file content in one go Once you retrieve the content you cannot use MimeMailParser_attachment::read()
getContentDisposition ( ) : string Retrieve the Attachment Content-Disposition
getContentID ( ) : string Retrieve the Attachment Content-ID
getContentType ( ) : string Retrieve the Attachment Content-Type
getFilename ( ) : string retrieve the attachment filename
getHeaders ( ) : array Retrieve the Attachment Headers
getMimePartStr ( ) : string Get mime part string for this attachment
getStream ( ) : stream Get a handle to the stream
read ( integer $bytes = 2082 ) : string | boolean Read the contents a few bytes at a time until completed Once read to completion, it always returns false

Method Details

__construct() public method

Attachment constructor.
public __construct ( string $filename, string $contentType, resource $stream, string $contentDisposition = 'attachment', string $contentId = '', array $headers = [], string $mimePartStr = '' )
$filename string
$contentType string
$stream resource
$contentDisposition string
$contentId string
$headers array
$mimePartStr string

getContent() public method

Retrieve the file content in one go Once you retrieve the content you cannot use MimeMailParser_attachment::read()
public getContent ( ) : string
return string

getContentDisposition() public method

Retrieve the Attachment Content-Disposition
public getContentDisposition ( ) : string
return string

getContentID() public method

Retrieve the Attachment Content-ID
public getContentID ( ) : string
return string

getContentType() public method

Retrieve the Attachment Content-Type
public getContentType ( ) : string
return string

getFilename() public method

retrieve the attachment filename
public getFilename ( ) : string
return string

getHeaders() public method

Retrieve the Attachment Headers
public getHeaders ( ) : array
return array

getMimePartStr() public method

Get mime part string for this attachment
public getMimePartStr ( ) : string
return string

getStream() public method

Get a handle to the stream
public getStream ( ) : stream
return stream

read() public method

Read the contents a few bytes at a time until completed Once read to completion, it always returns false
public read ( integer $bytes = 2082 ) : string | boolean
$bytes integer (default: 2082)
return string | boolean

Property Details

$content protected_oe property

File Content
protected string $content
return string

$contentDisposition protected_oe property

Content-Disposition (attachment or inline)
protected string $contentDisposition
return string

$contentId protected_oe property

Content-ID
protected string $contentId
return string

$contentType protected_oe property

Mime Type
protected string $contentType
return string

$filename protected_oe property

Filename
protected string $filename
return string

$headers protected_oe property

An Array of the attachment headers
protected array $headers
return array

$mimePartStr protected_oe property

protected string $mimePartStr
return string

$stream protected_oe property

protected resource $stream
return resource