Skip to content

aviatorhh/YaEP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

YaEP

Yet another Email Parser

There might be other email parsers for PHP around but I have taken the challenge to write a simple email parser that gives access to the different content types and extracts attachements.

Usage

The usage is straight forward.

$emailParser = new EmailParser(file_get_contents('test.eml'));

E.g. get the plain text part

$emailParser->getBody('text/plain');

Get the attachements

$attachements = $emailParser->getAttachements();

Store them somewhere if you like

foreach ($attachements as $a) {
	echo 'Saving attachement ' . $a->getFilename() . ' (' . $a->getContentType() . ')';
	$a->storeTo('/tmp/');
}

About

Yet another Email Parser

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages