Download the PHP package pecl/mailparse without Composer

On this page you can find all versions of the php package pecl/mailparse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mailparse

mailparse library for PHP

Mailparse is an extension for parsing and working with email messages.

It can deal with rfc822 and rfc2045 (MIME) compliant messages.

Mailparse is stream based, which means that it does not keep in-memory copies of the files it processes - so it is very resource efficient when dealing with large messages.

Version 2.1.6 is for PHP 5

OO Syntax

The rest of this document may be out of date! Take a look at the mailparse section of the online manual for more hints about this stuff.

$mime = mailparse_rfc2045_parse_file($file); $ostruct = mailparse_rfc2045_getstructure($mime); foreach($ostruct as $st) { $section = mailparse_rfc2045_find($mime, $st); $struct[$st] = mailparse_rfc2045_getinfo($section); } var_dump($struct); ?> array mailparse_rfc822_parse_addresses(string addresses) parses an rfc822 compliant recipient list, such as that found in To: From: headers. Returns a indexed array of assoc. arrays for each recipient: array(0 => array("display" => "Wez Furlong", "address" => "[email protected]"))

resource mailparse_rfc2045_create() Create a mime mail resource

boolean mailparse_rfc2045_parse(resource mimemail, string data) incrementally parse data into the supplied mime mail resource. Concept: you can stream portions of a file at a time, rather than read and parse the whole thing.

resource mailparse_rfc2045_parse_file(string $filename) Parse a file and return a $mime resource. The file is opened and streamed through the parser. This is the optimal way of parsing a mail file that you have on disk.

array mailparse_rfc2045_getstructure(resource mimemail) returns an array containing a list of message parts in the form: array("1", "1.1", "1.2")

resource mailparse_rfc2045_find(resource mimemail, string partname) returns an mime mail resource representing the named section

array mailparse_rfc2045_getinfo(resource mimemail) returns an array containing the bounds, content type and headers of the section.

mailparse_rfc2045_extract_file(resource mimemail, string filename[, string callbackfunc]) Extracts/decodes a message section from the supplied filename. If no callback func is supplied, it outputs the results into the current output buffer, otherwise it calls the callback with a string parameter containing the text. The contents of the section will be decoded according to their transfer encoding - base64, quoted-printable and uuencoded text are supported.

All operations are done incrementally; streaming the input and output so that memory usage is on the whole lower than something like procmail or doing this stuff in PHP space. The aim is that it stays this way to handle large quantities of email.

TODO:

. Add support for binhex encoding? . Extracting a message part without decoding the transfer encoding so that eg: pgp-signatures can be verified.

. Work the other way around - build up a rfc2045 compliant message file from simple structure information and filenames/variables.

vim:tw=78 vim600:syn=php:tw=78


All versions of mailparse with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pecl/mailparse contains the following files

Loading the files please wait ...