mailparse_rfc822_parse_addresses

(4.1.0 - 4.1.2 only, PECL)

mailparse_rfc822_parse_addresses --  Parse addresses and returns a hash containing that data

Description

array mailparse_rfc822_parse_addresses ( string addresses )

警告

本函数是实验性的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。

警告

本函数暂无文档,仅有参数列表。


add a note add a note User Contributed Notes
24-Nov-2004 08:12
An alternative to the mailparse_rfc822_parse_addresses() function is Mail_RFC822::parseAddressList() from Pear:

http://pear.php.net/manual/en/package.mail.mail.php

It parses the string and returns a structured tree of data. Returns a pear_error object if the string is not valid.

Example:

require_once "PEAR.php";
require_once "Mail/RFC822.php";
                                                                              
$addr= "Hi <hi@world.org>";
                                                                              
$res= Mail_RFC822::parseAddressList($addr);
if (PEAR::isError($res)) die("NOT VALID: " . $res->getMessage() . "\n");
echo "OK. Data:\n";
print_r($res);
mat at phpconsulting dot com
25-Apr-2003 12:59
If for some reason you cannot compile mailparse into your install of PHP, you will also find an extremely similar function in the Mail_MIME PEAR class, specifically in mimeDecode.php.