Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • Email
  • Encoding
  • Parser
  • Sender
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Parser

Mail parsing class. Based on \Mail\IMAPv2 class (c) Copyright 2004-2005 Richard York

Namespace: Jyxo\Mail
Category: Jyxo
Package: Jyxo\Mail
Subpackage: Parser
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Jaroslav HanslĂ­k
Located at Mail/Parser.php
Methods summary
public
# __construct( resource $connection, integer $uid )

Creates an instance.

Creates an instance.

Parameters

$connection
resource
IMAP folder connection.
$uid
integer
Message Id
public array
# getHeaders( string $pid = null )

Returns headers.

Returns headers.

Parameters

$pid
string
Part Id

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
public
# parseBody( string $pid = null, string $mimeType = 'text/html', boolean $alternative = true, boolean $all = false )

Parses message body.

Parses message body.

Parameters

$pid
string
Part Id
$mimeType
string
Default mime-type
$alternative
boolean
Should the alternative part be used as well
$all
boolean
Should all parts get parsed

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
public array
# getAttachments( )

Returns a list of attachments.

Returns a list of attachments.

Returns

array
public array
# getInlines( )

Returns a list of part Ids of inline parts.

Returns a list of part Ids of inline parts.

Returns

array
public array
# getRelatedParts( string $pid, array $types, boolean $all = false )

Returns related parts.

Returns related parts.

Parameters

$pid
string
Part Id
$types
array
List of types to search for
$all
boolean
Return all types

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
public array
# getAllRelatedParts( string $pid )

Returns all related parts.

Returns all related parts.

Parameters

$pid
string
Part Id

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
public array
# getBody( string $pid = '1', integer $mode = Jyxo\Mail\Parser::BODY, string $mimeType = 'text/html', integer $attempt = 1 )

Returns body of the given part.

Returns body of the given part.

Parameters

$pid
string
Part Id
$mode
integer
Body return mode
$mimeType
string
Requested mime-type
$attempt
integer
Number of retries

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
Jyxo\Mail\Parser\PartNotExistException
If no such part exists
public static string
# decodeBody( string $body, string $encoding )

Decodes body.

Decodes body.

Parameters

$body
string
Body
$encoding
string
Body encoding

Returns

string
public array
# getMime( array $types )

Returns a list of part Ids of given types.

Returns a list of part Ids of given types.

Parameters

$types
array
Part types

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
public array
# getMimeExcept( array $exceptTypes )

Returns a list of part Ids of all parts except for the given types.

Returns a list of part Ids of all parts except for the given types.

Parameters

$exceptTypes
array
Ignored part types

Returns

array

Throws

Jyxo\Mail\Parser\EmailNotExistException
If no such email exists
Constants summary
integer BODY 0
#

Retrieve message body. Search for possible alternatives.

Retrieve message body. Search for possible alternatives.

See

Jyxo\Mail\Parser::getBody()
integer BODY_INFO 1
#

Retrieve body info.

Retrieve body info.

See

Jyxo\Mail\Parser::getBody()
integer BODY_LITERAL 2
#

Retrieve raw message body.

Retrieve raw message body.

See

Jyxo\Mail\Parser::getBody()
integer BODY_LITERAL_DECODE 3
#

Retrieve decoded message body.

Retrieve decoded message body.

See

Jyxo\Mail\Parser::getBody()
Jyxo PHP Library API documentation generated by ApiGen 2.3.0