PHP 클래스 PhpMimeMailParser\Parser

Fully Tested Mailparse Extension Wrapper for PHP 5.4+
파일 보기 프로젝트 열기: exorus/php-mime-mail-parser 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$charset object
$data string A text of an email
$parts array Parts of an email
$resource resource PHP MimeParser Resource ID
$stream resource A file pointer to email

공개 메소드들

메소드 설명
__construct ( PhpMimeMailParser\Contracts\CharsetManager $charset = null ) Parser constructor.
__destruct ( ) : void Free the held resources
getAddresses ( string $name ) : array Return an array with the following keys display, address, is_group
getAttachments ( $include_inline = true ) : Attachment[] Returns the attachments contents in order of appearance
getCharset ( ) : PhpMimeMailParser\Contracts\CharsetManager Retrieve the charset manager object
getData ( ) : string Retrieve the text of an email
getHeader ( string $name ) : string Retrieve a specific Email Header
getHeaders ( ) : array Retrieve all mail headers
getHeadersRaw ( ) : string Retrieve the raw mail headers as a string
getMessageBody ( string $type = 'text' ) : false | string Returns the email message body in the specified format
getParts ( ) : array Retrieve the parts of an email
getRawHeader ( string $name ) : string Retrieve a specific Email Header, without charset conversion.
getResource ( ) : resource Retrieve the resource
getStream ( ) : resource Retrieve the file pointer to email
saveAttachments ( string $attach_dir, $include_inline = true ) : array Save attachments in a folder
setPath ( string $path ) : Parser Set the file path we use to get the email text
setStream ( resource $stream ) : Parser Set the Stream resource we use to get the email text
setText ( string $data ) : Parser Set the email text

보호된 메소드들

메소드 설명
decodeContentTransfer ( string $encodedString, string $encodingType ) : string Decode the string from Content-Transfer-Encoding
decodeHeader ( string | array $input ) : string $input can be a string or array
decodeSingleHeader ( string $input ) : string Decodes a single header (= string)
getAttachmentStream ( array &$part ) : resource Read the attachment Body and save temporary file resource
getEmbeddedData ( string $contentId ) : string Returns the embedded data structure
getPart ( string $type, array $parts ) : string | array Retrieve a specified MIME part
getPartBody ( array &$part ) : string Retrieve the Body of a MIME part
getPartBodyFromFile ( array &$part ) : string Retrieve the Body from a MIME part from file
getPartBodyFromText ( array &$part ) : string Retrieve the Body from a MIME part from text
getPartCharset ( array $part ) : string | false Return the charset of the MIME part
getPartComplete ( array &$part ) : string Retrieve the content of a MIME part
getPartFromFile ( array &$part ) : string Retrieve the content from a MIME part from file
getPartFromText ( array &$part ) : string Retrieve the content from a MIME part from text
getPartHeader ( &$part ) : String Retrieve the raw Header of a MIME part
getPartHeaderFromFile ( &$part ) : String Retrieve the Header from a MIME part from file
getPartHeaderFromText ( &$part ) : String Retrieve the Header from a MIME part from text
parse ( ) : void Parse the Message into parts

메소드 상세

__construct() 공개 메소드

Parser constructor.
public __construct ( PhpMimeMailParser\Contracts\CharsetManager $charset = null )
$charset PhpMimeMailParser\Contracts\CharsetManager

__destruct() 공개 메소드

Free the held resources
public __destruct ( ) : void
리턴 void

decodeContentTransfer() 보호된 메소드

Decode the string from Content-Transfer-Encoding
protected decodeContentTransfer ( string $encodedString, string $encodingType ) : string
$encodedString string The string in its original encoded state
$encodingType string The encoding type from the Content-Transfer-Encoding header of the part.
리턴 string The decoded string

decodeHeader() 보호된 메소드

$input can be a string or array
protected decodeHeader ( string | array $input ) : string
$input string | array
리턴 string

decodeSingleHeader() 보호된 메소드

Decodes a single header (= string)
protected decodeSingleHeader ( string $input ) : string
$input string
리턴 string

getAddresses() 공개 메소드

Return an array with the following keys display, address, is_group
public getAddresses ( string $name ) : array
$name string Header name (case-insensitive)
리턴 array

getAttachmentStream() 보호된 메소드

Read the attachment Body and save temporary file resource
protected getAttachmentStream ( array &$part ) : resource
$part array
리턴 resource Mime Body Part

getAttachments() 공개 메소드

Returns the attachments contents in order of appearance
public getAttachments ( $include_inline = true ) : Attachment[]
리턴 Attachment[]

getCharset() 공개 메소드

Retrieve the charset manager object
public getCharset ( ) : PhpMimeMailParser\Contracts\CharsetManager
리턴 PhpMimeMailParser\Contracts\CharsetManager charset

getData() 공개 메소드

Retrieve the text of an email
public getData ( ) : string
리턴 string data

getEmbeddedData() 보호된 메소드

Returns the embedded data structure
protected getEmbeddedData ( string $contentId ) : string
$contentId string Content-Id
리턴 string

getHeader() 공개 메소드

Retrieve a specific Email Header
public getHeader ( string $name ) : string
$name string Header name (case-insensitive)
리턴 string

getHeaders() 공개 메소드

Retrieve all mail headers
public getHeaders ( ) : array
리턴 array

getHeadersRaw() 공개 메소드

Retrieve the raw mail headers as a string
public getHeadersRaw ( ) : string
리턴 string

getMessageBody() 공개 메소드

Returns the email message body in the specified format
public getMessageBody ( string $type = 'text' ) : false | string
$type string text, html or htmlEmbedded
리턴 false | string Body or False if not found

getPart() 보호된 메소드

Retrieve a specified MIME part
protected getPart ( string $type, array $parts ) : string | array
$type string
$parts array
리턴 string | array

getPartBody() 보호된 메소드

Retrieve the Body of a MIME part
protected getPartBody ( array &$part ) : string
$part array
리턴 string

getPartBodyFromFile() 보호된 메소드

Retrieve the Body from a MIME part from file
protected getPartBodyFromFile ( array &$part ) : string
$part array
리턴 string Mime Body Part

getPartBodyFromText() 보호된 메소드

Retrieve the Body from a MIME part from text
protected getPartBodyFromText ( array &$part ) : string
$part array
리턴 string Mime Body Part

getPartCharset() 보호된 메소드

Return the charset of the MIME part
protected getPartCharset ( array $part ) : string | false
$part array
리턴 string | false

getPartComplete() 보호된 메소드

Retrieve the content of a MIME part
protected getPartComplete ( array &$part ) : string
$part array
리턴 string

getPartFromFile() 보호된 메소드

Retrieve the content from a MIME part from file
protected getPartFromFile ( array &$part ) : string
$part array
리턴 string Mime Content

getPartFromText() 보호된 메소드

Retrieve the content from a MIME part from text
protected getPartFromText ( array &$part ) : string
$part array
리턴 string Mime Content

getPartHeader() 보호된 메소드

Retrieve the raw Header of a MIME part
protected getPartHeader ( &$part ) : String
$part Object
리턴 String

getPartHeaderFromFile() 보호된 메소드

Retrieve the Header from a MIME part from file
protected getPartHeaderFromFile ( &$part ) : String
$part Array
리턴 String Mime Header Part

getPartHeaderFromText() 보호된 메소드

Retrieve the Header from a MIME part from text
protected getPartHeaderFromText ( &$part ) : String
$part Array
리턴 String Mime Header Part

getParts() 공개 메소드

Retrieve the parts of an email
public getParts ( ) : array
리턴 array parts

getRawHeader() 공개 메소드

Retrieve a specific Email Header, without charset conversion.
public getRawHeader ( string $name ) : string
$name string Header name (case-insensitive)
리턴 string

getResource() 공개 메소드

Retrieve the resource
public getResource ( ) : resource
리턴 resource resource

getStream() 공개 메소드

Retrieve the file pointer to email
public getStream ( ) : resource
리턴 resource stream

parse() 보호된 메소드

Parse the Message into parts
protected parse ( ) : void
리턴 void

saveAttachments() 공개 메소드

Save attachments in a folder
public saveAttachments ( string $attach_dir, $include_inline = true ) : array
$attach_dir string directory
리턴 array Saved attachments paths

setPath() 공개 메소드

Set the file path we use to get the email text
public setPath ( string $path ) : Parser
$path string File path to the MIME mail
리턴 Parser MimeMailParser Instance

setStream() 공개 메소드

Set the Stream resource we use to get the email text
public setStream ( resource $stream ) : Parser
$stream resource
리턴 Parser MimeMailParser Instance

setText() 공개 메소드

Set the email text
public setText ( string $data ) : Parser
$data string
리턴 Parser MimeMailParser Instance

프로퍼티 상세

$charset 보호되어 있는 프로퍼티

object
protected $charset

$data 보호되어 있는 프로퍼티

A text of an email
protected string $data
리턴 string

$parts 보호되어 있는 프로퍼티

Parts of an email
protected array $parts
리턴 array

$resource 보호되어 있는 프로퍼티

PHP MimeParser Resource ID
protected resource $resource
리턴 resource

$stream 보호되어 있는 프로퍼티

A file pointer to email
protected resource $stream
리턴 resource