webklex / laravel-imap
Laravel IMAP client
Fund package maintenance!
Ko Fi
www.buymeacoffee.com/webklex
Installs: 2 466 569
Dependents: 8
Suggesters: 0
Security: 1
Stars: 637
Watchers: 31
Forks: 181
Open Issues: 28
Requires
- php: ^8.0.2
- laravel/framework: >=6.0.0
- webklex/php-imap: ^5.3.0
- 5.3.0
- 5.2.0
- 4.1.2
- 4.0.0
- 3.0.0-alpha
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- dev-master / 1.0.x-dev
- 1.0.5.9
- 1.0.5.8
- 1.0.5.7
- 1.0.5.6
- 1.0.5.5
- 1.0.5.4
- 1.0.5.3
- 1.0.5.2
- 1.0.5.1
- 1.0.5.0
- 1.0.4.2
- 1.0.4.1
- 1.0.4.0
- 1.0.3.11
- 1.0.3.10
- 1.0.3.9
- 1.0.3.8
- 1.0.3.7
- 1.0.3.6
- 1.0.3.5
- 1.0.3.4
- 1.0.3.3
- 1.0.3.2
- 1.0.3.1
- 1.0.3.0
- 1.0.2.12
- 1.0.2.11
- 1.0.2.10
- 1.0.2.9
- 1.0.2.8
- 1.0.2.7
- 1.0.2.6
- 1.0.2.5
- 1.0.2.4
- 1.0.2.3
- 1.0.2.2
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-11-20 14:39:54 UTC
README
Description
Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app. This enables your app to not only respond to new emails but also allows it to read and parse existing mails and much more.
Official documentation: php-imap.com/frameworks/laravel
Discord: discord.gg/jCcZWCSq
Table of Contents
- Documentations
- Compatibility
- Installation
- Basic usage example
- Sponsors
- Known issues
- Support
- Features & pull requests
- Security
- Credits
- Supporters
- License
Documentations
- Legacy (< v2.0.0): legacy documentation
- Core documentation: php-imap.com
- Example Laravel Integration: Example Application
Compatibility
Installation
This library requires the mbstring
php module. Make sure to install or enable it if it isn't available.
sudo apt-get install php*-mbstring
Installation via composer:
composer require webklex/laravel-imap
Additional information such as troubleshooting, legacy support and package publishing can be found here: php-imap.com/frameworks/laravel/installation
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.
/** @var \Webklex\PHPIMAP\Client $client */ $client = Webklex\IMAP\Facades\Client::account('default'); //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().'<br />'; echo 'Attachments: '.$message->getAttachments()->count().'<br />'; 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'; } } }
Sponsors
Known issues
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 immediate or commercial support, feel free to send me a mail at github@webklex.com.
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 github@webklex.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.