IMAP Library for PHP

Overview

IMAP Library for PHP

Latest Version on Packagist Software License Build Status Total Downloads Hits

Description

PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication process as well. You can enable the php-imap module in order to handle edge cases, improve message decoding quality and is required if you want to use legacy protocols such as pop3.

Official documentation: php-imap.com

Laravel wrapper: webklex/laravel-imap

Table of Contents

Documentations

Basic usage example

This is a basic example, which will echo out all Mails within all imap folders and will move every message into INBOX.read. Please be aware that this should not be tested in real life and is only meant to gives an impression on how things work.

use Webklex\PHPIMAP\ClientManager;

$cm = new ClientManager('path/to/config/imap.php');

/** @var \Webklex\PHPIMAP\Client $client */
$client = $cm->account('account_identifier');

//Connect to the IMAP Server
$client->connect();

//Get all Mailboxes
/** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */
$folders = $client->getFolders();

//Loop through every Mailbox
/** @var \Webklex\PHPIMAP\Folder $folder */
foreach($folders as $folder){

    //Get all Messages of the current Mailbox $folder
    /** @var \Webklex\PHPIMAP\Support\MessageCollection $messages */
    $messages = $folder->messages()->all()->get();
    
    /** @var \Webklex\PHPIMAP\Message $message */
    foreach($messages as $message){
        echo $message->getSubject().'
'
; echo 'Attachments: '.$message->getAttachments()->count().'
'
; echo $message->getHTMLBody(); //Move the current Message to 'INBOX.read' if($message->move('INBOX.read') == true){ echo 'Message has ben moved'; }else{ echo 'Message could not be moved'; } } }

Known issues

Error Solution
Kerberos error: No credentials cache file found (try running kinit) (...) Uncomment "DISABLE_AUTHENTICATOR" inside your config and use the legacy-imap protocol

Support

If you encounter any problems or if you find a bug, please don't hesitate to create a new issue. However please be aware that it might take some time to get an answer. Off topic, rude or abusive issues will be deleted without any notice.

If you need commercial support, feel free to send me a mail at [email protected].

A little notice

If you write source code in your issue, please consider to format it correctly. This makes it so much nicer to read
and people are more likely to comment and help :)

```php

echo 'your php code...';

```

will turn into:

echo 'your php code...'; 

Features & pull requests

Everyone can contribute to this project. Every pull request will be considered but it can also happen to be declined.
To prevent unnecessary work, please consider to create a feature issue
first, if you're planning to do bigger changes. Of course you can also create a new feature issue if you're just wishing a feature ;)

Change log

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • Connection via Tor

    Connection via Tor

    Hi. Could you explain me why this conenct dont use the tor deamon running on my localhost? I see imap connect probes on my firewall through clear net : `include('vendor/autoload.php'); use Webklex\PHPIMAP\ClientManager; use Webklex\PHPIMAP\Client;

    $options = array([

    /*
    |--------------------------------------------------------------------------
    | Default date format
    |--------------------------------------------------------------------------
    |
    | The default date format is used to convert any given Carbon::class object into a valid date string.
    | These are currently known working formats: "d-M-Y", "d-M-y", "d M y"
    |
    */
    'date_format' => 'd-M-Y',
    
    /*
    |--------------------------------------------------------------------------
    | Default account
    |--------------------------------------------------------------------------
    |
    | The default account identifier. It will be used as default for any missing account parameters.
    | If however the default account is missing a parameter the package default will be used.
    | Set to 'false' [boolean] to disable this functionality.
    |
    */
    'default' => 'default',
    
    /*
    |--------------------------------------------------------------------------
    | Available IMAP options
    |--------------------------------------------------------------------------
    |
    | Available php imap config parameters are listed below
    |   -Delimiter (optional):
    |       This option is only used when calling $oClient->
    |       You can use any supported char such as ".", "/", (...)
    |   -Fetch option:
    |       IMAP::FT_UID  - Message marked as read by fetching the body message
    |       IMAP::FT_PEEK - Fetch the message without setting the "seen" flag
    |   -Fetch sequence id:
    |       IMAP::ST_UID  - Fetch message components using the message uid
    |       IMAP::ST_MSGN - Fetch message components using the message number
    |   -Body download option
    |       Default TRUE
    |   -Flag download option
    |       Default TRUE
    |   -Soft fail
    |       Default FALSE - Set to TRUE if you want to ignore certain exception while fetching bulk messages
    |   -RFC822
    |       Default TRUE - Set to FALSE to prevent the usage of \imap_rfc822_parse_headers().
    |                      See https://github.com/Webklex/php-imap/issues/115 for more information.
    |   -Debug enable to trace communication traffic
    |   -UID cache enable the UID cache
    |   -Fallback date is used if the given message date could not be parsed
    |   -Boundary regex used to detect message boundaries. If you are having problems with empty messages, missing
    |       attachments or anything like this. Be advised that it likes to break which causes new problems..
    |   -Message key identifier option
    |       You can choose between the following:
    |       'id'     - Use the MessageID as array key (default, might cause hickups with yahoo mail)
    |       'number' - Use the message number as array key (isn't always unique and can cause some interesting behavior)
    |       'list'   - Use the message list number as array key (incrementing integer (does not always start at 0 or 1)
    |       'uid'    - Use the message uid as array key (isn't always unique and can cause some interesting behavior)
    |   -Fetch order
    |       'asc'  - Order all messages ascending (probably results in oldest first)
    |       'desc' - Order all messages descending (probably results in newest first)
    |   -Disposition types potentially considered an attachment
    |       Default ['attachment', 'inline']
    |   -Common folders
    |       Default folder locations and paths assumed if none is provided
    |   -Open IMAP options:
    |       DISABLE_AUTHENTICATOR - Disable authentication properties.
    |                               Use 'GSSAPI' if you encounter the following
    |                               error: "Kerberos error: No credentials cache
    |                               file found (try running kinit) (...)"
    |                               or ['GSSAPI','PLAIN'] if you are using outlook mail
    |   -Decoder options (currently only the message subject and attachment name decoder can be set)
    |       'utf-8' - Uses imap_utf8($string) to decode a string
    |       'mimeheader' - Uses mb_decode_mimeheader($string) to decode a string
    |
    */
    'options' => [
        'delimiter' => '/',
        'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK,
        'sequence' => \Webklex\PHPIMAP\IMAP::ST_UID,
        'fetch_body' => true,
        'fetch_flags' => true,
        'soft_fail' => false,
        'rfc822' => true,
        'debug' => false,
        'uid_cache' => true,
        // 'fallback_date' => "01.01.1970 00:00:00",
        'boundary' => '/boundary=(.*?(?=;)|(.*))/i',
        'message_key' => 'list',
        'fetch_order' => 'asc',
        'dispositions' => ['attachment', 'inline'],
    'proxy' => [
    	    'socket' => "socks5://127.0.0.1:9050",
    	    'request_fulluri' => false,
    	    'username' => null,
    	    'password' => null,
    ],
        'common_folders' => [
            "root" => "INBOX",
            "junk" => "INBOX/Junk",
            "draft" => "INBOX/Drafts",
            "sent" => "INBOX/Sent",
            "trash" => "INBOX/Trash",
        ],
        'decoder' => [
            'message' => 'utf-8', // mimeheader
            'attachment' => 'utf-8' // mimeheader
        ],
        'open' => [
            // 'DISABLE_AUTHENTICATOR' => 'GSSAPI'
        ]
    ],
    
    /*
    |--------------------------------------------------------------------------
    | Available flags
    |--------------------------------------------------------------------------
    |
    | List all available / supported flags. Set to null to accept all given flags.
     */
    'flags' => ['recent', 'flagged', 'answered', 'deleted', 'seen', 'draft'],
    
    /*
    |--------------------------------------------------------------------------
    | Available events
    |--------------------------------------------------------------------------
    |
     */
    'events' => [
        "message" => [
            'new' => \Webklex\PHPIMAP\Events\MessageNewEvent::class,
            'moved' => \Webklex\PHPIMAP\Events\MessageMovedEvent::class,
            'copied' => \Webklex\PHPIMAP\Events\MessageCopiedEvent::class,
            'deleted' => \Webklex\PHPIMAP\Events\MessageDeletedEvent::class,
            'restored' => \Webklex\PHPIMAP\Events\MessageRestoredEvent::class,
        ],
        "folder" => [
            'new' => \Webklex\PHPIMAP\Events\FolderNewEvent::class,
            'moved' => \Webklex\PHPIMAP\Events\FolderMovedEvent::class,
            'deleted' => \Webklex\PHPIMAP\Events\FolderDeletedEvent::class,
        ],
        "flag" => [
            'new' => \Webklex\PHPIMAP\Events\FlagNewEvent::class,
            'deleted' => \Webklex\PHPIMAP\Events\FlagDeletedEvent::class,
        ],
    ],
    
    /*
    |--------------------------------------------------------------------------
    | Available masking options
    |--------------------------------------------------------------------------
    |
    | By using your own custom masks you can implement your own methods for
    | a better and faster access and less code to write.
    |
    | Checkout the two examples custom_attachment_mask and custom_message_mask
    | for a quick start.
    |
    | The provided masks below are used as the default masks.
     */
    'masks' => [
        'message' => \Webklex\PHPIMAP\Support\Masks\MessageMask::class,
        'attachment' => \Webklex\PHPIMAP\Support\Masks\AttachmentMask::class
    ]
    

    ]);

    $cm = new ClientManager($options);

    // Poczta INTERIA $client = $cm->make([ 'host' => '217.74.64.236', 'port' => 993, 'encryption' => 'ssl', 'validate_cert' => true, 'username' => '[email protected]', 'password' => 'pass', 'protocol' => 'imap', 'proxy' => [ 'socket' => "socks5://localhost:9050", 'request_fulluri' => false, 'username' => null, 'password' => null, ] ]); //Connect to the IMAP Server $client->connect();

    //Get all Mailboxes /** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */ $folders = $client->getFolders();

    //Loop through every Mailbox /** @var \Webklex\PHPIMAP\Folder $folder foreach($folders as $folder){

    //Get all Messages of the current Mailbox $folder
    // @var \Web$client->connect();
    

    //Get all Mailboxes /** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */ $folders = $client->getFolders();

    //Loop through every Mailbox /** @var \Webklex\PHPIMAP\Folder $folder foreach($folders as $folder){

    //Get all Messages of the current Mailbox $folder
    // @var \Webklex\PHPIMAP\Support\MessageCollection $messages
    $messages = $folder->messages()->all()->get();
    

    var_dump($folders); `

    opened by underattach 0
  • Webklex\PHPIMAP\Client::expunge() return type is wrong

    Webklex\PHPIMAP\Client::expunge() return type is wrong

    4.1.2 changed Webklex\PHPIMAP\Connection\Protocols\ProtocolInterface::expunge return type from bool to array, but didn't change Webklex\PHPIMAP\Client::expunge() return type.

    bug validated 
    opened by gitstashgithub 1
  • ImapProtocol::logout always throws 'not connected' Exception after upgraded to 4.1.2

    ImapProtocol::logout always throws 'not connected' Exception after upgraded to 4.1.2

    After the upgrade the logout function always throws the RuntimeException. I checked the $this->stream value and it's NULL.

    src/Connection/Protocols/ImapProtocol.php

    public function logout(): array {
            if (!$this->stream) {
                throw new RuntimeException('not connected');
            }
    
            $result = $this->requestAndResponse('LOGOUT', [], true);
    
            fclose($this->stream);
            $this->stream = null;
            $this->uid_cache = null;
    
            return $result;
        }
    

    Does anyone know how to solve this? Thanks!

    bug validated 
    opened by gitstashgithub 1
  • Read all folders?

    Read all folders?

    INBOX/Junk%20E-mail I have like this folder in Mozilla thunderbird and it's Junk/Spam. Beside this I also have Archive, Deleted Items and Sent folders.

    $folders = $client->getFolders();

    This returns only INBOX folder and nothing else. Can I get all folders and read emails inside each folder?

    question 
    opened by consigliere23 3
  • Attachments not found on some messages

    Attachments not found on some messages

    Describe the bug Attachment not show on specific message, if same message is open on Thunderbird, Outlook or other clients (even web one like Roundcube) the attachments are shown

    Used config All settings are default.

    Below the php-imap version: composer show webklex/php-imap

    name : webklex/php-imap descrip. : PHP IMAP client keywords : imap, mail, php-imap, pop3, webklex versions : * 4.1.2 type : library license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText homepage : https://github.com/webklex/php-imap source : [git] https://github.com/Webklex/php-imap.git 94bf93ae8868ac1e073cfbaef377f0ca1acac2bc dist : [zip] https://api.github.com/repos/Webklex/php-imap/zipball/94bf93ae8868ac1e073cfbaef377f0ca1acac2bc 94bf93ae8868ac1e073cfbaef377f0ca1acac2bc path : [REDACTED]/vendor/webklex/php-imap names : webklex/php-imap

    support issues : https://github.com/Webklex/php-imap/issues source : https://github.com/Webklex/php-imap/tree/4.1.2

    autoload psr-4 Webklex\PHPIMAP\ => src

    requires ext-fileinfo * ext-iconv * ext-json * ext-mbstring * ext-openssl * illuminate/pagination >=5.0.0 nesbot/carbon >=1.0 php >=7.0.0 symfony/http-foundation >=2.8.0

    requires (dev) phpunit/phpunit ~4.0

    suggests symfony/mime Recomended for better extension support

    Code to Reproduce call $attachments = $message -> getAttachments(); $attachments->count()

    return 0 even if an attachments is present.

    • if I do a var_dump($attachments) return an empty Attachments object

    Expected behavior I need to extract attachments from message using $attachment->getAttributes()['content']

    Screenshots thunderbird-attachment

    Desktop / Server (please complete the following information):

    • OS: Ubuntu 22.04.1 LTS
    • PHP: PHP 7.4.33 (cli) (built: Nov 8 2022 11:33:35) ( NTS )
    • Version webklex/php-imap 4.12
    • Provider: greenmail-standalone-2.0.0-alpha-2 for testing, Dovecot latest on production
    • Client: Thunderbird, Outlook, Roundcube (all are latest version)

    Additional context attached below you will find an eml that can be used to test this case, is zip compressed otherwise I can't upload it. 2 - test_attachment_not_reconized.zip

    opened by mdemori 1
Releases(4.1.2)
  • 4.1.2(Dec 14, 2022)

  • 4.1.1(Nov 16, 2022)

    Fixed

    • Fix for extension recognition #325 (thanks @pwoszczyk)
    • Missing null check added #327 (thanks @spanjeta)
    • Leading white-space in response causes an infinite loop #321 (thanks @thin-k-design)
    • Fix error when creating folders with special chars #319 (thanks @thin-k-design)
    • Client::getFoldersWithStatus() recursive loading fixed #312 (thanks @szymekjanaczek)
    • Fix Folder name encoding error in Folder::appendMessage() #306 #307 (thanks @rskrzypczak)
    Source code(tar.gz)
    Source code(zip)
  • 4.1.0(Oct 18, 2022)

    Fixed

    • Fix assumedNextTaggedLine bug #288 (thanks @Blear)
    • Fix empty response error for blank lines #274 (thanks @bierpub)
    • Fix empty body #233 (thanks @latypoff)
    • Fix imap_reopen folder argument #234 (thanks @latypoff)

    Added

    • Added possibility of loading a Folder status #298 (thanks @szymekjanaczek)
    Source code(tar.gz)
    Source code(zip)
  • 4.0.2(Aug 25, 2022)

  • 4.0.1(Aug 24, 2022)

    Fixed

    • Type casting added to several ImapProtocol return values #261
    • Remove IMAP::OP_READONLY flag from imap_reopen if POP3 or NNTP protocol is selected #135 (thanks @xianzhe18)
    • Several statements optimized and redundant checks removed
    • Check if the Protocol supports the fetch method if extensions are present
    • Detect NONEXISTENT errors while selecting or examining a folder #266
    • Missing type cast added to PaginatedCollection::paginate #267 (thanks @rogerb87)
    • Fix multiline header unfolding #250 (thanks @sulgie-eitea)
    • Fix problem with illegal offset error #226 (thanks @szymekjanaczek)
    • Typos fixed
    Source code(tar.gz)
    Source code(zip)
  • 4.0.0(Aug 19, 2022)

    Fixed

    • PHP dependency updated to support php v8.0 #212 #214 (thanks @freescout-helpdesk)
    • Method return and argument types added
    • Imap DONE method refactored
    • UID cache loop fixed
    • HasEvent::getEvent return value set to mixed to allow multiple event types
    • Protocol line reader changed to fread (stream_context timeout issue fixed)
    • Issue setting the client timeout fixed
    • IMAP Connection debugging improved
    • Folder::idle() method reworked and several issues fixed #170 #229 #237 #249 #258
    • Datetime conversion rules extended #189 #173

    Breaking changes

    • No longer supports php >=5.5.9 but instead requires at least php v7.0.0.
    • HasEvent::getEvent returns a mixed result. Either an Event or a class string representing the event class.
    • The error message, if the connection fails to read the next line, is now empty response instead of failed to read - connection closed?.
    • The $auto_reconnect used with Folder::indle() is deprecated and doesn't serve any purpose anymore.
    Source code(tar.gz)
    Source code(zip)
  • 3.2.0(Mar 7, 2022)

    Fixed

    • Fix attribute serialization #179 (thanks @netpok)
    • Use real tls instead of starttls #180 (thanks @netpok)
    • Allow to fully overwrite default config arrays #194 (thanks @laurent-rizer)
    • Query::chunked does not loop over the last chunk #196 (thanks @laurent-rizer)
    • Fix isAttachment that did not properly take in consideration dispositions options #195 (thanks @laurent-rizer)
    • Extend date parsing error message #173
    • Fixed 'Where' method replaces the content with uppercase #148
    • Don't surround numeric search values with quotes
    • Context added to InvalidWhereQueryCriteriaException
    • Redundant stream_set_timeout() removed

    Added

    • UID Cache added #204 (thanks @HelloSebastian)
    • Query::class extended with getByUidLower, getByUidLowerOrEqual , getByUidGreaterOrEqual , getByUidGreater to fetch certain ranges of uids #201 (thanks @HelloSebastian)
    • Check if IDLE is supported if Folder::idle() is called #199 (thanks @HelloSebastian)
    • Fallback date support added. The config option options.fallback_date is used as fallback date is it is set. Otherwise, an exception will be thrown #198
    • UID filter support added
    • Make boundary regex configurable #169 #150 #126 #121 #111 #152 #108 (thanks @EthraZa)
    • IMAP ID support added #174
    • Enable debug mode via config
    • Custom UID alternative support added
    • Fetch additional extensions using Folder::query(["FEATURE_NAME"])
    • Optionally move a message during "deletion" instead of just "flagging" it #106 (thanks @EthraZa)
    • WhereQuery::where() accepts now a wide range of criteria / values. #104

    Breaking changes

    • If you are using the legacy protocol to search, the results no longer return false if the search criteria could not be interpreted but instead return an empty array. This will ensure it is compatible to the rest of this library and no longer result in a potential type confusion.
    • Folder::idle will throw an Webklex\PHPIMAP\Exceptions\NotSupportedCapabilityException exception if IMAP isn't supported by the mail server
    • All protocol methods which had a boolean $uid option no longer support a boolean value. Use IMAP::ST_UID or IMAP::NIL instead. If you want to use an alternative to UID just use the string instead.
    • Default config option options.sequence changed from IMAP::ST_MSGN to IMAP::ST_UID.
    • Folder::query() no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features.
    Source code(tar.gz)
    Source code(zip)
  • 3.1.0-alpha(Feb 3, 2022)

    Fixed

    • Fix attribute serialization #179 (thanks @netpok)
    • Use real tls instead of starttls #180 (thanks @netpok)
    • Allow to fully overwrite default config arrays #194 (thanks @laurent-rizer)
    • Query::chunked does not loop over the last chunk #196 (thanks @laurent-rizer)
    • Fix isAttachment that did not properly take in consideration dispositions options #195 (thanks @laurent-rizer)

    Breaking changes

    • Default config parameters no longer persist after being merged if the given array contains fewer elements
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-alpha(Nov 4, 2021)

    Fixed

    • Extend date parsing error message #173
    • Fixed 'Where' method replaces the content with uppercase #148
    • Don't surround numeric search values with quotes
    • Context added to InvalidWhereQueryCriteriaException
    • Redundant stream_set_timeout() removed

    Added

    • Make boundary regex configurable #169 #150 #126 #121 #111 #152 #108 (thanks @EthraZa)
    • IMAP ID support added #174
    • Enable debug mode via config
    • Custom UID alternative support added
    • Fetch additional extensions using Folder::query(["FEATURE_NAME"])
    • Optionally move a message during "deletion" instead of just "flagging" it #106 (thanks @EthraZa)
    • WhereQuery::where() accepts now a wide range of criteria / values. #104

    Breaking changes

    • All protocol methods which had a boolean $uid option no longer support a boolean. Use IMAP::ST_UID or IMAP::NIL instead. If you want to use an alternative to UID just use the string instead.
    • Default config option options.sequence changed from IMAP::ST_MSGN to IMAP::ST_UID.
    • Folder::query() no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features.
    Source code(tar.gz)
    Source code(zip)
  • 2.7.2(Sep 27, 2021)

  • 2.7.1(Sep 8, 2021)

  • 2.7.0(Sep 4, 2021)

    Fixed

    • Fixes handling of long header lines which are seperated by \r\n\t (thanks @Oliver-Holz)
    • Fixes to line parsing with multiple addresses (thanks @Oliver-Holz)

    Added

    • Expose message folder path #154 (thanks @Magiczne)
    • Adds mailparse_rfc822_parse_addresses integration (thanks @Oliver-Holz)
    • Added moveManyMessages method (thanks @Magiczne)
    • Added copyManyMessages method (thanks @Magiczne)
    Source code(tar.gz)
    Source code(zip)
  • 2.6.0(Aug 20, 2021)

    Fixed

    • POP3 fixes #151 (thanks @Korko)

    Added

    • Added imap 4 handling. #146 (thanks @szymekjanaczek)
    • Added laravel's conditionable methods. #147 (thanks @szymekjanaczek)
    Source code(tar.gz)
    Source code(zip)
  • 2.5.1(Jun 19, 2021)

    Fixed

    • Fix setting default mask from config #133 (thanks @shacky)
    • Chunked fetch fails in case of less available mails than page size #114
    • Protocol::createStream() exception information fixed #137
    • Legacy methods (headers, content, flags) fixed #125
    • Legacy connection cycle fixed #124 (thanks @zssarkany)

    Added

    • Disable rfc822 header parsing via config option #115
    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Feb 1, 2021)

    Fixed

    • Attachment saving filename fixed
    • Unnecessary parameter removed from Client::getTimeout()
    • Missing encryption variable added - could have caused problems with unencrypted communications
    • Prefer attachment filename attribute over name attribute #82
    • Missing connection settings added to Folder:idle() auto mode #89
    • Message move / copy expect a folder path #79
    • Client::getFolder() updated to circumvent special edge cases #79
    • Missing connection status checks added to various methods
    • Unused default attribute message_no removed from Message::class

    Added

    • Dynamic Attribute access support added (e.g $message->from[0])
    • Message not found exception added #93
    • Chunked fetching support added Query::chunked(). Just in case you can't fetch all messages at once
    • "Soft fail" support added
    • Count method added to Attribute:class
    • Convert an Attribute instance into a Carbon date object #95

    Breaking changes

    • A new exception can occur if a message can't be fetched (\Webklex\PHPIMAP\Exceptions\MessageNotFoundException::class)
    • Message::move() and Message::copy() no longer accept folder names as folder path
    • A Message::class instance might no longer have a message_no attribute
    Source code(tar.gz)
    Source code(zip)
  • 2.4.4(Jan 22, 2021)

    Fixed

    • Boundary detection simplified #90
    • Prevent potential body overwriting #90
    • CSV files are no longer regarded as plain body
    • Boundary detection overhauled to support "related" and "alternative" multipart messages #90 #91
    Source code(tar.gz)
    Source code(zip)
  • 2.4.3(Jan 21, 2021)

    Fixed

    • Attachment detection updated #82 #90
    • Timeout handling improved
    • Additional utf-8 checks added to prevent decoding of unencoded values #76

    Added

    • Auto reconnect option added to Folder::idle() #89
    Source code(tar.gz)
    Source code(zip)
  • 2.4.2(Jan 9, 2021)

    Fixed

    • Attachment::save() return error 'A facade root has not been set' #87
    • Unused dependencies removed
    • Fix PHP 8 error that changes null back in to an empty string. #88 (thanks @mennovanhout)
    • Fix regex to be case insensitive #88 (thanks @mennovanhout)
    Source code(tar.gz)
    Source code(zip)
  • 2.4.1(Jan 6, 2021)

    Fixed

    • Debug line position fixed
    • Handle incomplete address to string conversion #83
    • Configured message key gets overwritten by the first fetched message #84
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Jan 3, 2021)

    Fixed

    • Get partial overview when IMAP::ST_UID is set #74
    • Unnecessary "'" removed from address names
    • Folder referral typo fixed
    • Legacy protocol fixed
    • Treat message collection keys always as strings

    Added

    • Configurable supported default flags added
    • Message attribute class added to unify value handling
    • Address class added and integrated
    • Alias Message::attachments() for Message::getAttachments() added
    • Alias Message::addFlag() for Message::setFlag() added
    • Alias Message::removeFlag() for Message::unsetFlag() added
    • Alias Message::flags() for Message::getFlags() added
    • New Exception MessageFlagException::class added
    • New method Message::setSequenceId($id) added
    • Optional Header attribution option added

    Breaking changes

    • Stringified message headers are now separated by ", " instead of " ".
    • All message header values such as subject, message_id, from, to, etc now consists of an Àttribute::class instance (should behave the same way as before, but might cause some problem in certain edge cases)
    • The formal address object "from", "to", etc now consists of an Address::class instance (should behave the same way as before, but might cause some problem in certain edge cases)
    • When fetching or manipulating message flags a MessageFlagException::class exception can be thrown if a runtime error occurs
    • Learn more about the new Attribute class here: www.php-imap.com/api/attribute
    • Learn more about the new Address class here: www.php-imap.com/api/address
    • Folder attribute "referal" is now called "referral"
    Source code(tar.gz)
    Source code(zip)
  • 2.3.1(Dec 30, 2020)

    Fixed

    • Missing RFC attributes added
    • Set the message sequence when idling
    • Missing UID commands added #64

    Added

    • Get a message by its message number
    • Get a message by its uid #72 #66 #63
    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Dec 21, 2020)

    Fixed

    • Cert validation issue fixed
    • Allow boundaries ending with a space or semicolon (thanks @smartilabs)
    • Ignore IMAP DONE command response #57
    • Default options.fetch set to IMAP::FT_PEEK
    • Address parsing fixed #60
    • Alternative rfc822 header parsing fixed #60
    • Parse more than one Received: header #61
    • Fetch folder overview fixed
    • Message::getTextBody() fallback value fixed

    Added

    • Proxy support added #53 (thanks @consigliere23)
    • Flexible disposition support added #58
    • New options.message_key option uid added
    • Protocol UID support added
    • Flexible sequence type support added

    Breaking changes

    • Depending on your configuration, your certificates actually get checked. Which can cause an aborted connection if the certificate can not be validated.
    • Messages don't get flagged as read unless you are using your own custom config.
    • All Header::class attribute keys are now in a snake_format and no longer minus-separated.
    • Message::getTextBody() no longer returns false if no text body is present. null is returned instead.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.5(Dec 11, 2020)

  • 2.2.4(Dec 8, 2020)

    Fixed

    • Search performance increased by fetching all headers, bodies and flags at once #42
    • Legacy protocol support updated
    • Fix Query pagination. (#52 @mikemiller891)

    Added

    • Missing message setter methods added
    • Folder::overview() method added to fetch all headers of all messages in the current folder
    Source code(tar.gz)
    Source code(zip)
  • 2.2.3(Nov 2, 2020)

    Fixed

    • Text/Html body fetched as attachment if subtype is null #34
    • Potential header overwriting through header extensions #35
    • Prevent empty attachments #37

    Added

    • Set fetch order during query #41 @Max13
    Source code(tar.gz)
    Source code(zip)
  • 2.2.2(Oct 20, 2020)

  • 2.2.1(Oct 19, 2020)

    Fixed

    • Header decoding problem fixed #31

    Added

    • Search for messages by message-Id
    • Search for messages by In-Reply-To
    • Message threading added Message::thread()
    • Default folder locations added
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Oct 16, 2020)

    Fixed

    • Prevent text bodies from being fetched as attachment #27
    • Missing variable check added to prevent exception while parsing an address webklex/laravel-imap #356
    • Missing variable check added to prevent exception while parsing a part subtype #27
    • Missing variable check added to prevent exception while parsing a part content-type webklex/laravel-imap #356
    • Mixed message header attribute in_reply_to "unified" to be always an array #26
    • Potential message moving / copying problem fixed #29
    • Move messages by using Protocol::moveMessage() instead of Protocol::copyMessage() and Message::delete() #29

    Added

    • Protocol::moveMessage() method added #29

    Breaking changes

    • Text bodies might no longer get fetched as attachment ( don't get me wrong - this is a good thing ;) )
    • Message::$in_reply_to type changed from mixed to array
    Source code(tar.gz)
    Source code(zip)
  • 2.1.13(Oct 13, 2020)

  • 2.1.12(Oct 13, 2020)

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
Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

PHP IMAP 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 NNT

Sergey 1.5k Jan 3, 2023
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
EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby

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
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
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
Small PHP library to valid email addresses using a number of methods.

Email Validator Small PHP library to valid email addresses using a number of methods. Features Validates email address Checks for example domains (e.g

James Jackson 154 Dec 31, 2022
📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.

?? Handy email creation and transfer library for PHP with both text and MIME-compliant support.

Nette Foundation 401 Dec 22, 2022
Library for using online Email providers

Stampie Stampie have been moved to the "Flint" organization in order to get a better collaborative flow. Stampie is a simple API Wrapper for different

Henrik Bjørnskov 32 Oct 7, 2020
Library for using online Email providers

Stampie Stampie is a simple API Wrapper for different email providers such as Postmark and SendGrid. It is very easy to use and to integrate into your

Stampie 288 Dec 31, 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
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
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
Bounce Mail Handler for PHP | This is a "reboot" of PHPMailer-BMH from WorxWare.

PHP 7.0+ Support Composer & PSR-0 Support PHPUnit testing via Travis CI (TODO: more tests needed) PHP-Quality testing via SensioLabsInsight (TODO: mor

Lars Moelleken 43 Jan 7, 2023
Cypht: Lightweight Open Source webmail written in PHP and JavaScript

All your E-mail, from all your accounts, in one place. Cypht is not your father's webmail. Unless you are one of my daughters, in which case it is your father's webmail. Cypht is like a news reader, but for E-mail. Cypht does not replace your existing accounts - it combines them into one. And it's also a news reader.

Jason Munro 773 Dec 30, 2022
Crud PHP 8 com Form E-mail

Crud com PHP 8 PDO Login - Cadastro de Usuários - Edição - Deleção - Adição | Formulário envio de e-mail Para rodar o Crud é preciso instalar um servi

Isaias Oliveira 4 Nov 16, 2021
PHPMailer – A full-featured email creation and transfer class 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 19.1k Jan 2, 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