处理来自变量的邮件内容的示例
<?php
$buffer = [...] // 来自管道或其他地方的邮件内容
$mail = mailparse_msg_create();
mailparse_msg_parse($mail,$buffer);
$struct = mailparse_msg_get_structure($mail);
foreach($struct as $st) {
$section = mailparse_msg_get_part($mail, $st);
$info = mailparse_msg_get_part_data($section);
print_r($info);
}
?>