E-mail List Splitting
Posted: Tue Jan 22, 2008 9:36 am
Hi all,
not been here in a while.
Got another complicated question to ask, hopefully, even if you do not know the answer somebody might be able to point me in the right direction.
I am working on e-mail address lists at the moment and I could not find a way of splitting e-mail addresses in accordance to rfc2822.
Take this example:
From: "Joe Q. Public" <john.q.public@example.com>
To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>
Cc: <boss@nil.test>, "Giant; \"Big\" Box" <sysservices@example.net>
Date: Tue, 1 Jul 2003 10:52:37 +0200
Message-ID: <5678.21-Nov-1997@example.com>
In the example the e-mail addresses are as follows:
I was hoping somebody knew some regex that could do this?
not been here in a while.
Got another complicated question to ask, hopefully, even if you do not know the answer somebody might be able to point me in the right direction.
I am working on e-mail address lists at the moment and I could not find a way of splitting e-mail addresses in accordance to rfc2822.
Take this example:
From: "Joe Q. Public" <john.q.public@example.com>
To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>
Cc: <boss@nil.test>, "Giant; \"Big\" Box" <sysservices@example.net>
Date: Tue, 1 Jul 2003 10:52:37 +0200
Message-ID: <5678.21-Nov-1997@example.com>
In the example the e-mail addresses are as follows:
Code: Select all
$email_addresses['"Joe Q. Public"'] = 'john.q.public@example.com';
$email_addresses['Mary Smith'] = 'mary@x.test';
$email_addresses[] = 'jdoe@example.org';
$email_addresses['Who?'] = 'one@y.test';
$email_addresses[] = 'boss@nil.test';
$email_addresses['"Giant; \"Big\" Box"'] = 'sysservices@example.net';