Re: Parsing the From field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 19, 2011 at 11:23:59AM -0500, Ron Piggott wrote:
> 
> I am unsure of how to parse first name, last name and e-mail address from the 'From:' field of an e-mail.
> 
> What I am struggling with is if the name has more than two words 
> - Such as the last name being multiple words
> - A name a business or department is given instead of a personal name
> - If the person has included their middle name, middle initial or degrees (“Dr.”)
> - If last name has multiple words
> 
> Also the formatting of the from field changes in various e-mail programs:
> 
> From: Ron Piggott <ron.piggott@xxxxxxxxxxxxxxxxxx>
> From: "Ron Piggott" <ron.piggott@xxxxxxxxxxxxxxxxxx>
> From: ron.piggott@xxxxxxxxxxxxxxxxxx
> From: <ron.piggott@xxxxxxxxxxxxxxxxxx>
> 
> If there is more than 2 words for the name I would like them to be assigned to the last name.

You can make no such assumption, different people/companies/... do it in different ways.
If you really want to have fun look at the different 'norms' from different countries.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux