LXXX. Mailparse Functions

Introdução

Mailparse is an extension for parsing and working with email messages. It can deal with RFC 822 and RFC 2045 (MIME) compliant messages.

Mailparse is stream based, which means that it does not keep in-memory copies of the files it processes - so it is very resource efficient when dealing with large messages.

Nota: Mailparse requires the mbstring extension.

Esta extensão foi movida para o repositório PECL e não é mais distribuida em conjunto com o PHP a partir do PHP 4.2.0.

Instalação

Esta estensão PECL não vem compilada com o PHP. Informações para a instalação desta extensão PECL podem ser encontradas no manual no capitulo entitulado Instalação de extensões PECL. Informações adicionais como novas versões, downloads, arquivos fontes, manutenções, e um Changelog, podem ser obtidos aqui: http://pecl.php.net/package/mailparse.

In order to use these functions you must compile PHP with mailparse support by using the --enable-mailparse configure option.

Windows users will enable php_mailparse.dll inside of php.ini in order to use these functions. Você pode baixar esta extensão PECL DLL a apartir de downloads PHP ou em http://snaps.php.net/.

Configurações em execução

O comportamento dessas funções podem ser modificado pelas configurações do php.ini.

Tabela 1. Mailparse configuration options

NameDefaultChangeableChangelog
mailparse.def_charset"us-ascii"PHP_INI_ALL 
Para mais detalhes e definições das constantes PHP_INI_*, veja Apêndice H.

Constantes pré-definidas

As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução.

MAILPARSE_EXTRACT_OUTPUT (integer)

MAILPARSE_EXTRACT_STREAM (integer)

MAILPARSE_EXTRACT_RETURN (integer)

Índice
mailparse_determine_best_xfer_encoding -- Gets the best way of encoding
mailparse_msg_create -- Create a mime mail resource
mailparse_msg_extract_part_file -- Extracts/decodes a message section
mailparse_msg_extract_part --  Extracts/decodes a message section
mailparse_msg_extract_whole_part_file -- Extracts a message section including headers without decoding the transfer encoding
mailparse_msg_free -- Frees a MIME resource
mailparse_msg_get_part_data -- Returns an associative array of info about the message
mailparse_msg_get_part -- Returns a handle on a given section in a mimemessage
mailparse_msg_get_structure -- Returns an array of mime section names in the supplied message
mailparse_msg_parse_file -- Parses a file
mailparse_msg_parse -- Incrementally parse data into buffer
mailparse_rfc822_parse_addresses -- Parse RFC 822 compliant addresses
mailparse_stream_encode --  Streams data from source file pointer, apply encoding and write to destfp
mailparse_uudecode_all --  Scans the data from fp and extract each embedded uuencoded file