PHP Velho Oeste 2024

mailparse_msg_parse_file

(PECL mailparse >= 0.9.0)

mailparse_msg_parse_fileファイルをパースする

説明

mailparse_msg_parse_file(string $filename): resource

ファイルをパースします。 ディスク上にあるメールファイルをパースするための最良の方法です。

パラメータ

filename

メッセージを保持するファイルへのパス。 このファイルがオープンされ、ストリームとしてパーサに流し込まれます。

注意:

filename が保持するメッセージは、 改行コード(CRLF) で終わることが想定されています。 そうでない場合、最後の行がパースされません。

戻り値

構造を表す MIME リソース、あるいはエラー時に false を返します。

注意

注意:

この関数が作成したリソースが必要なくなった際は、 メモリリークを避けるため mailparse_msg_free() をコールすることを推奨します。

参考

add a note add a note

User Contributed Notes 1 note

up
2
schmidt at cube hyphen concept dot com
2 years ago
I just encountered an internal server error by simply calling
$eml = mailparse_msg_parse_file("$path/eml/$email_id.eml");

The error disappeared after adding
mailparse_msg_free($eml);
to the end of the script.

Without mailparse_msg_free i keep getting an internal server error.
To Top