PHP Classes

Extract Name from Email Address: Extract person name from e-mail address header

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-11-18 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 327 All time: 6,798 This week: 788Up
Version License PHP version Categories
extract-name-email 1.2.2Free To Use But R...5.0Email, PHP 5, Text processing
Description Author

This class can extract person name from e-mail address header.

It can parse given e-mail header line that should contain a person name and attempts to extract the person name from it.

The class uses certain heuristics to evaluate common ways people put their names in e-mail addresses to split the person names in its multiple parts.

A dictionary of common people names may be used to assure that the extracted names are part of the actual person name.

Innovation Award
PHP Programming Innovation award nominee
September 2012
Number 5
Some applications receive e-mail messages from users that do not specify their real name.

This class tries to guess the real name of a person that uses given e-mail address by parsing the address and splitting it in possible names that make part of the person real name.

Manuel Lemos
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 5 packages by
Country: Hong Kong Hong Kong
Age: ???
All time rank: 11525 in Hong Kong Hong Kong
Week rank: 1179 Down5 in Hong Kong Hong Kong Equal
Innovation award
Innovation award
Nominee: 2x


This PHP class extracts real name and email address from email address header.

It is optimised to process both single and multiple email address headers.

This class was nominated for INNOVATION AWARD (September 2012) at


Copyright 2012-2014 Peter Kahl (

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Change Log

1.2.2 ..... 2014-11-19
    Changed license to Apache License, Version 2.0.

1.2.1 ..... 2014-02-06
    Clean up for strict PHP standards.

1.2.0 ..... 2013-11-05
  Added method to extract email address. Bug fix.

1.1.2 ..... 2013-10-29
  Added stripping of quotation marks from addresses such as
  "jarrodmilne&#64;company.tld" &lt;jarrodmilne&#64;company.tld&gt;.
  Added some names to name dictionary.

1.1.1 ..... 2013-10-21
  Added ability to extract from addresses such as
  "user name&#64;domain.tld &lt;user&#64;domain.tld&gt;".

1.1.0 ..... 2013-10-21
  Added ability to decode encoded header string such as
  "=?iso-2022-jp?B?GyRCS1EbKEIgGyRCSH5JMRsoQiA=?= &lt;blah&#64;;".
  to "name_extractor".

1.0.2 ..... 2012-11-29
  Fixed typo where _ should have been - (hyphen) on line 58.

1.0.1 ..... 2012-11-02
  Added link to repo on GitHub.
  Renamed the class from "colossal_mind_extract_name_from_email_address"

1.0.0 ..... 2012-05-29
  Initial release

  Files folder image Files  
File Role Description
Plain text file Class The main class
Accessible without login Plain text file dictionary-names.php Aux. Dictionary of common names
Accessible without login Plain text file example-1.php Example Process single address
Accessible without login Plain text file example-2.php Example Process multiple addresses
Accessible without login Plain text file Doc. Readme

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,798
This week:788Up