messaged/php-mime-mail-parser

This package is abandoned and no longer maintained. The author suggests using the php-mime-mail-parser/php-mime-mail-parser package instead.

Mailparse extension wrapper for PHP 5.3+

Maintainers

👁 message

Package info

github.com/message/php-mime-mail-parser

Homepage

pkg:composer/messaged/php-mime-mail-parser

Statistics

Installs: 142 190

Dependents: 2

Suggesters: 0

Stars: 62

Open Issues: 1

v1.0.7 2015-01-04 16:11 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

CC BY-SA 3.0 e129df8e95d83f8bff52936a37ae227d820c4e92

mailmimemailparseMimeMailParser

This package is not auto-updated.

Last update: 2022-02-01 12:22:11 UTC


README

THIS REPOSITORY IS DEPRECATED. MOVED TO https://github.com/php-mime-mail-parser/php-mime-mail-parser

PHP 5.3+ Fork of http://code.google.com/p/php-mime-mail-parser

Contributions

Feel free to contribute.

Composer

"require": {
	"messaged/php-mime-mail-parser": "v1.0.7"
}

Usage example

use MimeMailParser\Parser;
use MimeMailParser\Attachment;

$parser = new Parser();
$parser->setText(file_get_contents('/path/to/mail'));

$to = $parser->getHeader('to');
$delivered_to = $parser->getHeader('delivered-to');
$from = $parser->getHeader('from');
$subject = $parser->getHeader('subject');
$text = $parser->getMessageBody('text');
$html = $parser->getMessageBody('html');
$attachments = $parser->getAttachments();

// Write attachments to disk
foreach ($attachments as $attachment) {
 $attachment->saveAttachment('/tmp');
}