Forum und email

Mailparse Functions

簡介

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.

Note: Mailparse requires the mbstring extension, and mbstring must be loaded before mailparse.

本擴充功能已被移動到 » PECL 函式庫中且自以下版本起不再被包含到 PHP 中:4.2.0.

安裝

» PECL 擴充功能未包含於 PHP 中。 安裝此 PECL 擴充功能的訊息可在手冊中標題為 PECL 擴充功能安裝的一章中找到。 更多訊息如新版本,下載,原始文件,維護者訊息以及更新日誌等可以在這裡找到: » https://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. 可以從 » PHP 下載頁面或者 » https://snaps.php.net/ 下載此 PECL 擴充功能的 DLL 文件。

執行時期設定

這些函式的行為受 php.ini 的影響。

Mailparse configuration options
Name Default Changeable Changelog
mailparse.def_charset "us-ascii" PHP_INI_ALL Available since PHP 4.1.0. Removed in PHP 4.2.0.
有關 PHP_INI_* 常數進一步的細節與定義參見php.ini directives

預設常數

以下常數由擴充功能定義,因此只有在擴充功能被編譯到 PHP 中,或者在執行時被動態載入後才有效。

MAILPARSE_EXTRACT_OUTPUT (integer)
MAILPARSE_EXTRACT_STREAM (integer)
MAILPARSE_EXTRACT_RETURN (integer)

Table of Contents