Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

Related tags

Email php-imap
Overview

PHP IMAP

GitHub release Software License Packagist Build Status Supported PHP Version Maintainability Test Coverage Type Coverage

Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNTP using the PHP IMAP extension. This library allows you to fetch emails from your email server. Extend the functionality or create powerful web applications to handle your incoming emails.

Features

  • Connect to mailbox by POP3/IMAP/NNTP, using PHP IMAP extension
  • Get emails with attachments and inline images
  • Get emails filtered or sorted by custom criteria
  • Mark emails as seen/unseen
  • Delete emails
  • Manage mailbox folders

Requirements

PHP Version php-imap Version
5.6 3.x
7.0 3.x
7.1 3.x
7.2 3.x, 4.x
7.3 3.x, 4.x
7.4 >3.0.33, 4.x
  • PHP fileinfo extension must be present; so make sure this line is active in your php.ini: extension=php_fileinfo.dll
  • PHP iconv extension must be present; so make sure this line is active in your php.ini: extension=php_iconv.dll
  • PHP imap extension must be present; so make sure this line is active in your php.ini: extension=php_imap.dll
  • PHP mbstring extension must be present; so make sure this line is active in your php.ini: extension=php_mbstring.dll

Installation by Composer

Install the latest available release:

$ composer require php-imap/php-imap

Install the latest available and stable source code from master, which is may not released / tagged yet:

$ composer require php-imap/php-imap:dev-master

Install the latest available and may unstable source code from develop, which is may not properly tested yet:

$ composer require php-imap/php-imap:dev-develop

Run Tests

Before you can run the any tests you may need to run composer install to install all (development) dependencies.

Run all tests

You can run all available tests by running the following command (inside of the installed php-imap directory): composer run tests

Run only PHPUnit tests

You can run all PHPUnit tests by running the following command (inside of the installed php-imap directory): php vendor/bin/phpunit --testdox

Integration with frameworks

Getting Started Example

Below, you'll find an example code how you can use this library. For further information and other examples, you may take a look at the wiki.

// Create PhpImap\Mailbox instance for all further actions
$mailbox = new PhpImap\Mailbox(
	'{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder
	'[email protected]', // Username for the before configured mailbox
	'*********', // Password for the before configured username
	__DIR__, // Directory, where attachments will be saved (optional)
	'UTF-8' // Server encoding (optional)
);

// set some connection arguments (if appropriate)
$mailbox->setConnectionArgs(
    CL_EXPUNGE // expunge deleted mails upon mailbox close
    | OP_SECURE // don't do non-secure authentication
);

try {
	// Get all emails (messages)
	// PHP.net imap_search criteria: http://php.net/manual/en/function.imap-search.php
	$mailsIds = $mailbox->searchMailbox('ALL');
} catch(PhpImap\Exceptions\ConnectionException $ex) {
	echo "IMAP connection failed: " . $ex;
	die();
}

// If $mailsIds is empty, no emails could be found
if(!$mailsIds) {
	die('Mailbox is empty');
}

// Get the first message
// If '__DIR__' was defined in the first line, it will automatically
// save all attachments to the specified directory
$mail = $mailbox->getMail($mailsIds[0]);

// Show, if $mail has one or more attachments
echo "\nMail has attachments? ";
if($mail->hasAttachments()) {
	echo "Yes\n";
} else {
	echo "No\n";
}

// Print all information of $mail
print_r($mail);

// Print all attachements of $mail
echo "\n\nAttachments:\n";
print_r($mail->getAttachments());

Method imap() allows to call any imap function in a context of the the instance:

// Call imap_check();
// http://php.net/manual/en/function.imap-check.php
$info = $mailbox->imap('check'); //

// Show current time for the mailbox
$currentServerTime = isset($info->Date) && $info->Date ? date('Y-m-d H:i:s', strtotime($info->Date)) : 'Unknown';

echo $currentServerTime;

Some request require much time and resources:

// If you don't need to grab attachments you can significantly increase performance of your application
$mailbox->setAttachmentsIgnore(true);

// get the list of folders/mailboxes
$folders = $mailbox->getMailboxes('*');

// loop through mailboxs
foreach($folders as $folder) {

	// switch to particular mailbox
	$mailbox->switchMailbox($folder['fullpath']);

	// search in particular mailbox
	$mails_ids[$folder['fullpath']] = $mailbox->searchMailbox('SINCE "1 Jan 2018" BEFORE "28 Jan 2018"');
}

print_r($mails_ids);

Recommended

Comments
  • [Feature Request] I Want to All Email in Directory and Spam Directory

    [Feature Request] I Want to All Email in Directory and Spam Directory

    Is your feature request related to a problem? Please describe. Users reading only inbox emails. But we want to all emails(in directory, tagged emails, in spam directory)

    needs investigation 
    opened by gdemir 0
  • [BUG] Why is the time to get the email previous?

    [BUG] Why is the time to get the email previous?

    Environment (please complete the following information):

    • PHP IMAP version: dev-master
    • PHP Version: 7.4
    • Type of execution: CLI

    Describe the bug The latest reply time of the email is 17:55 on January 2, 2023, but the time I read it is 05:02 on December 27, 2022. Why is the time to get the email previous?

    The used code:

    $mailbox = new \PhpImap\Mailbox(
                '{mail.abyshoes.com:993/imap/ssl/novalidate-cert}INBOX', // IMAP server and mailbox folder
                '[email protected]', // Username for the before configured mailbox
                '********', // Password for the before configured username
                $this->savePath, // Directory, where attachments will be saved (optional)
                'UTF-8', // Server encoding (optional)
                true, // Trim leading/ending whitespaces of IMAP path (optional)
                false // Attachment filename mode (optional; false = random filename; true = original filename)
            );
            $mailId = 2798601;
            $mail = $mailbox->getMail($mailId, false);
    
            dump($mail->headers);
            die();
    

    The headers of the parsed email, if required and possible (only, if it's NOT confidential):

    Delivered-To: [email protected]
    Received: from iZj6cdljn9u61oxgdblg0iZ
    	by iZj6ccbk1bxo1foz1m5vi1Z with LMTP id aDczHrvBsmObGAAAJnNHSg
    	for ; Mon, 02 Jan 2023 19:36:27 +0800
    Received: from out20-63.mail.aliyun.com (out20-63.mail.aliyun.com [115.124.20.63])
    	by iZj6cdljn9u61oxgdblg0iZ (Postfix) with ESMTPS id 3B5CF21AE7
    	for ; Mon,  2 Jan 2023 19:36:07 +0800 (CST)
    DKIM-Filter: OpenDKIM Filter v2.11.0 iZj6cdljn9u61oxgdblg0iZ 3B5CF21AE7
    Authentication-Results: iZj6cdljn9u61oxgdblg0iZ;
    	dkim=pass (2048-bit key) header.d=gmail.com [email protected] header.b="e2XCMWhQ"
    X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R701e2;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047199;[email protected];NM=1;PH=DM;RN=1;RT=1;SC=80;SR=1;TI=MTA_---.QidqEUE_1672659349;
    Received: from mail-lf1-f42.google.com(mailfrom:[email protected] ip:209.85.167.42)
              by mx1.aliyun-inc.com;
              Mon, 02 Jan 2023 19:35:50 +0800
    Received: by mail-lf1-f42.google.com with SMTP id j17so31741891lfr.3
            for ; Mon, 02 Jan 2023 03:35:50 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
            d=gmail.com; s=20210112;
            h=to:subject:message-id:date:from:in-reply-to:references:mime-version
             :from:to:cc:subject:date:message-id:reply-to;
            bh=LDf1TGbIMtsPN1RKRTGwW/lejf9JZusQsYKFabO3To8=;
            b=e2XCMWhQugF46gr9uvQKiOgGb/uOf1bJG6ewJvv+FET2X+Kfbo1JXHAC+UhItyy2NH
             tdXcBBfku6hxR3PamTgqjnChbyreeJij8yBC64iDxO0v69GTcni+2FRmyzgWdsdtxkTS
             tb0ueHic+NsowPUZMgWbCq6S6yhsgtWiFsptYsO+9d1UUjMC0Ks6ZTFh8qA31/1w4Jea
             0YvRwZB4GsOKmelbry/1Fh7UcMNXIUzUIAZ+kWvs9GiJlKNsQzbyJPB62h9yhuqMvRKh
             cx43r9YbU7dxB4UYhCzAiewMNRtJYJ+DvaAOCdFcv8voA2aL5L3tqs2RlfYqnNC1Q/zY
             1gLQ==
    X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
            d=1e100.net; s=20210112;
            h=to:subject:message-id:date:from:in-reply-to:references:mime-version
             :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
            bh=LDf1TGbIMtsPN1RKRTGwW/lejf9JZusQsYKFabO3To8=;
            b=WAPV8mgrBuz83apRJlr3moenS0LXuhtoinU/FXDq96nQdrjJBGTzlPITy54UpnoSN2
             je8afhWr0fV/MwdPjU2DWdv3T04qeaKhSTJjL4vzWRRzi3vSgdtFw6hQcxgAjAgU82nc
             wSf9+GBnGoPuF/x3q3iNyYLvq+xk9Yl6Qk3iBjl5hUMVjfBO99J5FdWK5WXQLv2Gbk6m
             jftQH7/+c0bSXeBrnMpTyKFMXDsvCjMaI6CDC1oieXYG4z0riPoxT5yFZp5L7G9/oU8I
             0MYt6bFY/ITM+i3g+/TUZo0OR5tjD3j6VeZ8RPQDtqhm8FjEXeEQ0jNKYUKutFFw3TMc
             NXsg==
    X-Gm-Message-State: AFqh2koQ4Pl36WXmLMIvjIiLG5TQpjhJXkIAYkjNqDjBF2FZyuhmU0C2
    	qze9f3WUHSBcuOFnz/fWCYYcFSckSv3cL6B5oHaG9s9W
    X-Google-Smtp-Source: AMrXdXtT6druIxwNUoISHWNRe2SLc5Y09P9TaoQJv43xPbNj7xFByLCfonQFz2o9BmK3BTuGBQUNm3lxI5txE4kTwts=
    X-Received: by 2002:a05:6512:2528:b0:4b6:e956:54a2 with SMTP id
     be40-20020a056512252800b004b6e95654a2mr2113189lfb.663.1672659348726; Mon, 02
     Jan 2023 03:35:48 -0800 (PST)
    MIME-Version: 1.0
    References: 
    In-Reply-To: 
    From: selecionando amigos 
    Date: Mon, 26 Dec 2022 18:02:43 -0300
    Message-ID: 
    Subject: =?UTF-8?Q?Re=3A_compra_n=C3=A3o_concretiza?=
    To: Senay 
    Content-Type: multipart/alternative; boundary="0000000000004fa86805f1465a67"
    
    

    Expected behavior image The email date should be equal to the one circled above

    needs investigation 
    opened by Airam1016 0
  • [BUG] Fatal error: Uncaught Error: Call to undefined method PhpImap\IncomingMailAttachment::setFilePath()

    [BUG] Fatal error: Uncaught Error: Call to undefined method PhpImap\IncomingMailAttachment::setFilePath()

    The used code:

    // composer packages load
    require_once "vendor/autoload.php";
    use PhpImap\Exceptions\ConnectionException;
    use PhpImap\Mailbox;
    $mailbox = new Mailbox(
            '{imap.yandex.com.tr:993/imap/ssl/novalidate-cert}INBOX', // IMAP server and mailbox folder
            '[email protected]', // Username for the before configured mailbox
            '********', // Password for the before configured username
    	__DIR__ . '/upload/', // Directory, where attachments will be saved (optional)
            'UTF-8', // Server encoding (optional)
             true, // Trim leading/ending whitespaces of IMAP path (optional)
             false // Attachment filename mode (optional; false = random filename; true = original filename)
         );
        // Save attachments one by one
        $count_email_attachments = count($email->getAttachments());
        if ($count_email_attachments != 0) {
            $attachments = $email->getAttachments();
            
            foreach ($attachments as $attachment) {
                echo '--> Saving '.(string) $attachment->name.'...';
    
                // Set individually filePath for each single attachment
                // In this case, every file will get the current Unix timestamp
                $attachment->setFilePath(__DIR__.'/upload/'. $attachment->name);
    
                if ($attachment->saveToDisk()) {
                    echo "OK, saved!\n";
                } else {
                    echo "ERROR, could not save!\n";
                }
            }
        }
    

    Screenshots / Outputs Fatal error: Uncaught Error: Call to undefined method PhpImap\IncomingMailAttachment::setFilePath() in /var/www/vhosts/v9.haberpanelim.com/httpdocs/ir/index.php:57 Stack trace: #0 {main} thrown in /var/www/vhosts/v9.haberpanelim.com/httpdocs/ir/index.php on line 57

    needs investigation 
    opened by gdemir 0
  • [BUG] Fatal error: Uncaught Error: Call to undefined method PhpImap\Mailbox::getAttachmentsIgnore()

    [BUG] Fatal error: Uncaught Error: Call to undefined method PhpImap\Mailbox::getAttachmentsIgnore()

    The used code:

    // composer packages load
    require_once "vendor/autoload.php";
    use PhpImap\Exceptions\ConnectionException;
    use PhpImap\Mailbox;
    $mailbox = new Mailbox(
            '{imap.yandex.com.tr:993/imap/ssl/novalidate-cert}INBOX', // IMAP server and mailbox folder
            '[email protected]', // Username for the before configured mailbox
            '********', // Password for the before configured username
    	__DIR__ . '/upload/', // Directory, where attachments will be saved (optional)
            'UTF-8', // Server encoding (optional)
             true, // Trim leading/ending whitespaces of IMAP path (optional)
             false // Attachment filename mode (optional; false = random filename; true = original filename)
         );
        // Save attachments one by one
        if (!$mailbox->getAttachmentsIgnore()) {
            $attachments = $email->getAttachments();
    
    

    Screenshots / Outputs Fatal error: Uncaught Error: Call to undefined method PhpImap\Mailbox::getAttachmentsIgnore() in /var/www/vhosts/httpdocs/ir/index.php:47 Stack trace: #0 {main} thrown in /var/www/vhosts/httpdocs/ir/index.php on line 47

    needs investigation 
    opened by gdemir 0
  • [BUG] Uncaught Error: Call to undefined method PhpImap\IncomingMail::hasAttachments()

    [BUG] Uncaught Error: Call to undefined method PhpImap\IncomingMail::hasAttachments()

    The used code:

    // composer packages load
    require_once "vendor/autoload.php";
    use PhpImap\Exceptions\ConnectionException;
    use PhpImap\Mailbox;
    $mailbox = new Mailbox(
            '{imap.yandex.com.tr:993/imap/ssl/novalidate-cert}INBOX', // IMAP server and mailbox folder
            '[email protected]', // Username for the before configured mailbox
            '********', // Password for the before configured username
    	__DIR__ . '/upload/', // Directory, where attachments will be saved (optional)
            'UTF-8', // Server encoding (optional)
             true, // Trim leading/ending whitespaces of IMAP path (optional)
             false // Attachment filename mode (optional; false = random filename; true = original filename)
         );
        echo 'mail has attachments? ';
        if ($email->hasAttachments()) {
            echo "Yes\n";
        } else {
            echo "No\n";
        }
    

    Screenshots / Outputs Fatal error: Uncaught Error: Call to undefined method PhpImap\IncomingMail::hasAttachments() in /var/www/vhosts/httpdocs/ir/index.php:53 Stack trace: #0 {main} thrown in /var/www/vhosts//httpdocs/ir/index.php on line 53

    needs investigation 
    opened by gdemir 0
  • Embedded images missing

    Embedded images missing

    PHP IMAP version: 5.0.1 PHP Version: 8.1 Type of execution: CLI or Web Server

    Found three bugs with attached images that are embedded. Here is the description and a fix proposal.

    Bug Nr. 1) No matter if $mailbox->setAttachmentsIgnore() is set to true or false. In both cases the images are broken. Created email: Screenshot 2022-12-28 | 00 25 29

    Output of received email with php-imap: Screenshot 2022-12-28 | 00 26 33

    The reason is that the nice function embedImageAttachments() in IncomingMail.php (Line 208) which had been written to autmatically show the embedded images is never used.

    I found a fix for that. But then I found ...

    Bug Nr. 2 If this function embedImageAttachments() is used, images will appear but they get again broken as soon $mailbox->setAttachmentsIgnore() ist set to true.

    I could fix it, but then I found ...

    Bug Nr. 3 Instead of displaying three different images the first image is display three times. The sources are not correctly assigned to the img tags. I found the reason for this. Surprisingly $attachments = $this->getAttachments(); in IncomingMail.php (around Line 220) returns always only one (the very first) attachment. This is strange, since it should be an array with all attchments in it. I could not find out why, but I'm absolutely sure and proofed it well, it contains only one key(!). So output will surely fail with multiple attachments. But also the rest of the code was not right. So I had to change a bit more here.

    Fixed result: Screenshot 2022-12-28 | 02 16 12

    I'd herewith like to share the solution:

    CHANGE A) In IncomingMail.php completely exchange the function embedImageAttachments() (very end in php) with this code:

      /**
         * Embed inline image attachments as base64 to allow for
         * email html to display inline images automatically.
         */
        public function embedImageAttachments($ignoreAttachments = false, $attachments = [false]): void
        {
            $fetchedHtml = $this->__get('textHtml');
    
            // strip out embedded images ( detected by src="cid: in img tag) if ignore attachments is set
            if ($ignoreAttachments) $this->textHtml = preg_replace('/(<IMG(.+?)src=\"cid\:(.+?)\>)/mi', '', $this->textHtml);
    
            // attachments not ignored
            if (!$ignoreAttachments) {
    
                \preg_match_all("/\bcid:[^'\"\s]{1,256}/mi", $fetchedHtml, $matches);
    
                if (isset($matches[0]) && \is_array($matches[0]) && \count($matches[0])) {
                    /** @var list<string> */
                    $matches = array_unique($matches[0]); // <- remove duplicates
    
                    $cidAry = [];
                    $cid    = '';
    
                    if (is_array($matches) && $matches)
                    foreach ($matches as $match) {
                       $cidAry[] = \str_replace('cid:', '', $match);
                    }
    
                    if (is_array($attachments) && $attachments)
                    foreach ($attachments as $attachment) {
                        /**
                         * Inline images can contain a "Content-Disposition: inline", but only a "Content-ID" is also enough.
                         * See https://github.com/barbushin/php-imap/issues/569.
                         */
                        if (in_array($attachment->contentId, $cidAry)) {
                            $cid         = $attachment->contentId;
                            $contents    = $attachment->getContents();
                            $contentType = $attachment->getFileInfo(FILEINFO_MIME_TYPE);
    
                            if (!\strstr($contentType, 'image')) {
                                continue;
                            } 
                            elseif (!\is_string($attachment->id)) {
                                throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.'() does not have an id specified!');
                            }
    
                            $base64encoded = \base64_encode($contents);
                            $replacement = 'data:'.$contentType.';base64, '.$base64encoded;
    
                            $this->textHtml = \str_replace('src="cid:'.$cid.'"', 'src="'.$replacement.'"', $this->textHtml);
    
    			/** TODO (as enhancement): it would be a good idea to treat the attachment removal of subsequent 
    			 * line like an settable option since the attached inline images will not be saved to disk like all 
    			 * the other attachments.
    			 *
    			 * Thus commented subsequent line. But the attachment removal works! 
    			 * Just uncomment it, if you like to show the images inline AND also save them as attachments to disk.
    			 */
                            //$this->removeAttachment($attachment->id);
                        }
                    }
                }
            }
        }
    

    CHANGE B) To init the function and to submit the ignore setting and also the correct attachments array. In Mailbox.php in the function getMail() around the Line Nr.1331/1332:

    Change end of function from

            return $mail;
    }
    

    to:

            if($mail->hasAttachments() == true) $mail->embedImageAttachments($this->getAttachmentsIgnore(), $mail->getAttachments());
    
            return $mail;
    }
    
    needs investigation 
    opened by oioix 1
Releases(5.0.1)
  • 5.0.1(Dec 5, 2022)

    What's Changed

    • Fix for IMAP\Connection is already closed #680 by @underdpt in https://github.com/barbushin/php-imap/pull/690
    • Prevent TypeError while constructing ConnectionException. by @Andrew-Staves-Activ in https://github.com/barbushin/php-imap/pull/674

    New Contributors

    • @Andrew-Staves-Activ made their first contribution in https://github.com/barbushin/php-imap/pull/674

    Full Changelog: https://github.com/barbushin/php-imap/compare/5.0.0...5.0.1

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0(Mar 12, 2022)

    What's Changed

    • Drop support for EoL PHP versions by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/667

    Starting with this release, the PHP versions 7.2 and 7.3 are not supported anymore by this project. Only PHP 7.4, 8.0 and 8.1 are supported.

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.5.3...5.0.0

    Source code(tar.gz)
    Source code(zip)
  • 4.5.3(Mar 12, 2022)

    What's Changed

    • Issue #657: Fix encoding issues by @christianasche / @Sebi94nbg in https://github.com/barbushin/php-imap/pull/666

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.5.2...4.5.3

    Source code(tar.gz)
    Source code(zip)
  • 4.5.2(Feb 17, 2022)

    What's Changed

    • Fix php-cs-fixer formatting issue by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/661
    • Bugfix: An argument $reverse of method \PhpImap\Imap::sort() has type boolean from PHP version 8 only by @alebedev80 in https://github.com/barbushin/php-imap/pull/659

    New Contributors

    • @alebedev80 made their first contribution in https://github.com/barbushin/php-imap/pull/659

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.5.1...4.5.2

    Source code(tar.gz)
    Source code(zip)
  • 4.5.1(Jan 10, 2022)

    What's Changed

    • #655: Add missing PHP 8.1 support by @christianasche / @Sebi94nbg in https://github.com/barbushin/php-imap/pull/656

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.5.0...4.5.1

    Source code(tar.gz)
    Source code(zip)
  • 4.5.0(Jan 8, 2022)

    What's Changed

    • #529: Add email flags as properties by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/653
    • #585: Avoid fetching attachments when they are already downloaded by @yrccondor / @Sebi94nbg in https://github.com/barbushin/php-imap/pull/654

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.4.0...4.5.0

    Source code(tar.gz)
    Source code(zip)
  • 4.4.0(Jan 7, 2022)

    What's Changed

    • Update outdated readme by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/649
    • Fix incorrect badge code in README by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/650
    • Fix workflow pipeline by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/651
    • #571: Improve ConnectionException handling by @Sebi94nbg in https://github.com/barbushin/php-imap/pull/652

    Full Changelog: https://github.com/barbushin/php-imap/compare/4.3.0...4.4.0

    Source code(tar.gz)
    Source code(zip)
  • 4.3.0(Dec 27, 2021)

    • Fix various de-/encoding issues
    • #604: Add X-Original-To header property
    • #582: Make Cc-list equivalent to To-list
    • #603: Add support for IMAP paths with leading/ending whitespaces
    • Add support for original filename for attachments
    • Add support for PHP 8.1
    • Deduplication of code for collecting the header properties
    • General code style improvements
    • Fix various pipeline issues
    Source code(tar.gz)
    Source code(zip)
  • 4.2.1(Nov 21, 2021)

  • 4.2.0(Nov 20, 2021)

    • Fix various encoding issues
    • Fix broken inline images
    • Fix incorrect MIME decoding
    • Fix deprecated methods
    • Avoid TypeError due to $lastError being boolean (false) instead of a string (strict types)
    • Add support for PHP 8.x
    • Added new automated test cases, improved and removed some existing ones
    • Fixed and improved Travis CI integration
    • General code optimizations
    Source code(tar.gz)
    Source code(zip)
  • 4.1.0(Jun 14, 2020)

    • #250: Fixed searchMailbox() could not search Chinese subject
    • #406: Added new properties (imapPath and mailboxFolder) to the incoming mail header
    • #416: Added new properties for mail attachments
    • #490: Fixed IncomingMail->textPlain contains attachments
    • #494: Fixed ConnectionException is never thown
    • #496: Fixed preg_match_all() error in replaceInternalLinks and embedImageAttachments
    • #499: Fixed error imap_open(): Couldn't open stream for mailboxes with non ASCII characters
    • #500: See notes regarding test cases for #499
    • #501: Fixed empty Body: Exception -> Can not decode an empty string
    • #509: Fixed Charset ks_c_5601-1987 not working
    • #510: Added support for bitmask options
    • #514: Fixed inline images returning cid:filename
    • Added new automated test cases
    • Fixed and improved Travis CI integration
    • General code optimizations
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0(Apr 22, 2020)

    • Dropped PHP 5.6 support, as it went end-of-life (EOL) on the 31st of December, 2018: https://www.php.net/eol.php
    • Dropped PHP 7.0 support, as it went end-of-life (EOL) on the 10th of January, 2019: https://www.php.net/eol.php
    • Dropped PHP 7.1 support, as it went end-of-life (EOL) on the 1st of December, 2019: https://www.php.net/eol.php
    • #403, #447, #479: Improved MIME decoding
    • #485: Fixed ENCBASE64 decoding
    • Fixed all Travis CI issues
    • Updated psalm baseline
    • Satisfied php-cs-fixer
    • Added phpcpd to detect duplicated code
    • Added phpmnd to detect magic numbers
    • PHPUnit: Added and improved / updated test cases
    • PR #485: Added some test cases for base64 decoding
    • Fully replaced Mailbox::convertStringEncoding() with Mailbox::decodeMimeStr()
    • Improved composer.json
    • Updated README with PHP version overview
    • Updated requirements in README
    • Updated badges in README
    • Removed not yet working OAuth code
    • This and all upcoming releases contain a Travis CI LIVE mailbox test
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0(Apr 10, 2020)

    • General source code optimizations (eg. deduplicated source code)
    • Improved PhpUnit tests
    • Coverage will be generated and uploaded now to CodeClimate
    • CodeClimate and PhpCs related fixes / improvements
    • Improved / Beautified composer config
    • Improved TravisCI implementation
    • TravisCI checks now with the stable PHP 7.4 build
    • Added psalm as static analysis tool
    • Fixed typehints
    • Added method for multi sender search
    • Added general-purpose merging search method
    Source code(tar.gz)
    Source code(zip)
  • 3.0.33(Nov 30, 2019)

  • 3.0.32(Nov 12, 2019)

    • Issue #390: Fixed, that attached HTML files got merged into the textHtml property
    • Issue #397: convertStringEncoding() will now always return a string and never throw an exception
    • Issue #398: Fixed issue, that files could not be manually (one by one) saved to disk using saveToDisk()
    • Issue #400: Fixed issue, that empty() returned a wrong result for strings with only whitespaces
    • Updated some PhpDoc comment-blocks
    • Improved code of DataPartInfo to be more human-readable
    • Removed wrong if-condition in DataPartInfo::fetch()
    • Fixed a few PhpCS warnings (eg. Expected type X, but Y given)
    • Resorted $attachment property assignments based on IncomingMailAttachment properties order
    • Fixed issues reported by Travis CI
    Source code(tar.gz)
    Source code(zip)
  • 3.0.31(Oct 31, 2019)

    • Improvements to the PhpDoc Tests (Thanks to @nicolus)
    • iconv() in convertStringEncoding() tried TRANSLIT first before IGNORE (thanks to @MekDrop)
    • Improvements for getCombinedPath() and switchMailbox() (Thanks to @agrisvv)
    • Improvements for the attachments (Thanks to @twmobius)
    • Fixed some incorrect thrown exceptions
    • Supress iconv() error messages
    • #393: Return original string, if conversion fails
    • #394: Improved error handling in initImapStream()
    • #383: Header datetime is now parsed and returned as RFC 3339 compliant format and if this is not possible, the original format will be returned
    • Fixed coding standards
    Source code(tar.gz)
    Source code(zip)
  • 3.0.30(Sep 7, 2019)

  • 3.0.28(Jul 23, 2019)

  • 3.0.27(Jul 13, 2019)

    • PR #361: Fixes "decodeMimeStr() Can not decode an empty" error when mail has no subject
    • Issue #358, #364, PR #365: Flatten mail parts before parsing (Handle Gmail multipart/related way of structuring mail with attachments)
    • PR #366: trim $to->personal field before decoding
    • Issue #359: Updated code logic for CC, BCC, REPLY-TO to same as for TO
    • Issue #360: Improved usage of property $imapPath
    • Fixed coding standards
    Source code(tar.gz)
    Source code(zip)
  • 3.0.26(Jun 14, 2019)

    This version does not have any code changes.

    There were only changes to the formatting of the comments and code, so the builds no longer fail.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.25(Jun 13, 2019)

    • Added Visual Studio Code to gitignore
    • Issue #198: Added magic function __isset() to fix incorrect booleans for isset() and empty() on IncomingMail[] properties
    • Added a comment to magic function __get()
    • Fixed a few PHP CS issues
    Source code(tar.gz)
    Source code(zip)
  • 3.0.24(Jun 13, 2019)

    • Added php_codesniffer (phpcs) as dev requirement for checking the code
    • Added working examples
    • Issue #198: Fixed incorrect parsed multipart mails
    • CodeClimate: Added example files to ignore list
    Source code(tar.gz)
    Source code(zip)
  • 3.0.22(Jun 7, 2019)

    • PR #341 / Issue #278: Fixed parsing of parts does not work properly
    • PR #345: Added iconv() as fallback for mb_convert_encoding() to avoid broken encodings
    Source code(tar.gz)
    Source code(zip)
  • 3.0.21(Jun 4, 2019)

    • Issue #336: Updated requirements and relevant PHPUnit test; Fixed undefined function mb_list_encodings()
    • Issue #335: Added some more PHPUnit tests for en- and decoding strings
    • Issue #338: Avoid duplicated files from the same mail
    • Issue #340: Show, if email has attachments or not without processing these
    • Issue #339: Fixed decoding issue with mailbox folder names (Thanks to @MomentD)
    • PR #342: Fix many typos (Thanks to @quentinus95)
    • PR #343: Add missing required ext (Thanks to @quentinus95)
    Source code(tar.gz)
    Source code(zip)
  • 3.0.20(May 25, 2019)

  • 3.0.19(May 24, 2019)

  • 3.0.18(May 23, 2019)

  • 3.0.17(May 18, 2019)

    • Fix an issue that checking valid params in the setConnectionArgs function
    • Issue #324: Changed string encoding from decodeMimeStr() to convertStringEncoding()
    • Removed first check, if param is array as it would never throw an exception otherwise
    • Added info to setConnectionArgs(), which option is invalid
    • PR #325: PHPUnit tests were not working as expected
    Source code(tar.gz)
    Source code(zip)
Owner
Sergey
Sergey
An AngularJS / Laravel app - Keyword Based Email forwarder | read/write emails through IMAP

@MailTree Simple mail forwarder. Based on the specific email body/subject keywords forward mails to the list of predefined users. Install Imap Install

Dren Kajmakchi 4 Aug 21, 2018
An IMAP library for PHP

Fetch Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols. Installing N.b. A note on Ubuntu 14.04 (probab

Tedious Developments 500 Dec 25, 2022
IMAP Library for PHP

IMAP Library for PHP Description PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled.

null 157 Jan 7, 2023
Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols

Fetch Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols. Installing N.b. A note on Ubuntu 14.04 (probab

Tedious Developments 501 Jan 4, 2023
A ready-to-use PHP script for sending Emails with an HTML Template will use a Gmail account as the sender and you will not need any email server. Powered by PHPMailer.

Gmail Email Sender by PHP A ready-to-use PHP script for sending Emails with an HTML Template will use a Gmail account as the sender and you will not n

Max Base 4 Oct 29, 2022
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.

CssToInlineStyles class Installation CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline style

Tijs Verkoyen 5.7k Dec 29, 2022
The Mailer component helps sending emails

Mailer Component The Mailer component helps sending emails. Getting Started $ composer require symfony/mailer use Symfony\Component\Mailer\Transport;

Symfony 1.1k Jan 7, 2023
Allows you to archive old emails from one Gmail mailbox to another Gmail mailbox

Gmail Archiver L'application Gmail archiver permet de déplacer automatiquement tous les vieux mails d'une boite Gmail vers une autre boite Gmail (ou é

Arnaud Lemercier 19 Jan 27, 2022
Queue, preview and and send emails stored in the database.

Codeigniter4 email queue Queue, preview and and send emails stored in the database. This package provides an interface for creating emails on the fly

null 3 Apr 12, 2022
Offer an online version of your Laravel emails to users.

This is was a collaborative project with Ryan Chandler. Please consider supporting him for the hard work he put into this package! Help support the ma

Sam Carré 251 Dec 25, 2022
Store outgoing emails in Laravel

Record and view all sent emails Watch a video walkthrough https://www.youtube.com/watch?v=Oj_OF5n4l4k&feature=youtu.be Documentation and install instr

David Carr 203 Dec 15, 2022
Mail Web is a Laravel package which catches emails locally for debugging

Mail Web is a Laravel package which catches emails locally for debugging Installation Use the package manager composer to install Mail Web. composer r

Appoly 64 Dec 24, 2022
Send beautiful HTML emails with Laravel

Beautymail for Laravel Beautymail makes it super easy to send beautiful responsive HTML emails. It's made for things like: Welcome emails Password rem

null 1.1k Jan 2, 2023
This application (class) does the sending of emails used in the phpmailer library

emailsender - PHP Notification library via email using phpMailer This library has the function of sending email using the phpmailer library. Doing thi

Lucas Alcantara Rodrigues Volpati 1 Feb 9, 2022
Laravel mailer which will catch all the sent emails and show them on an application view.

Laravel Web Mailer This package contains a web mailer which will catch all the sent emails. Then, you can view it visiting the route /web-inbox. The e

Creagia 54 Dec 16, 2022
Provides a clean and simple way to configure the WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice

WP PHPMailer provides a clean and simple way to configure the WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice.

Itineris Limited 61 Dec 6, 2022
The classic email sending library for PHP

PHPMailer – A full-featured email creation and transfer class for PHP Features Probably the world's most popular code for sending email from PHP! Used

PHPMailer 19k Jan 1, 2023
Comprehensive mailing tools for PHP

Swift Mailer Swift Mailer is a component based mailing solution for PHP. It is released under the MIT license. Swift Mailer is highly object-oriented

Swiftmailer 9.6k Dec 29, 2022
PHP library for parsing plain text email content.

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

William Durand 606 Dec 8, 2022