• Stars
    star
    560
  • Rank 79,541 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.

IMAP Library for Laravel

Latest release on Packagist Latest prerelease on Packagist Software License Code quality Total Downloads Hits Discord Snyk

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

Version PHP 5.6 PHP 7 PHP 8
v5.x / / X
v4.x / X X
v3.x / X /
v2.x X X /
v1.x X / /

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

Feline

Known issues

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

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 [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.

More Repositories

1

php-imap

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.
PHP
187
star
2

laravel-pdfmerger

A FPDI PDF Wrapper for Laravel which includes the "merge" functionality
PHP
66
star
3

laravel-git-hook

Automatic git deployment for Laravel
PHP
17
star
4

tbm

Fetch all your bookmarked tweets and make them accessible through a webinterface.
CSS
16
star
5

altip

Convert an IP into Alternative / Obfuscated versions of itself
Go
14
star
6

gogeoip

GoGeoIP - a lightweight web api providing ip intelligence written in GO. This software provides an api to get as many information as possible for a given IP address or the current visitor. This includes network, system, location and user information.
Go
12
star
7

romb

Rust
7
star
8

PostfixADM

PostfixADM is a modern postfix management tool. It is designed to work with almost any setup that is based on postfix, dovecot and mysql.
PHP
6
star
9

python_amazon_price_tracker

Python Amazon Price Tracker
Python
4
star
10

gohits

An easy way to track your page or project views ("hits") of any GitHub or online project.
Go
3
star
11

php-geoip

PHP-GeoIP provides you with the ability to gather open source ip intelligence by using the open api provided by https://github.com/Webklex/gogeoip.
PHP
2
star
12

gogeoip-gui

Example GUI for webklex/gogeoip
HTML
2
star
13

wappalyzer

Cli app based upon https://github.com/projectdiscovery/wappalyzergo
Go
2
star
14

laravel_imap_example

This is an example application to showcase the integration of `webklex/laravel-imap`.
PHP
2
star
15

thunderbird-spam-score-column

A simple Mozilla Thunderbird add-on that adds a sortable column to display the contents of SpamAssassin's X-Spam-Score header.
JavaScript
2
star
16

translator

This is a translator package provides everything you need to get started with a quiet fast CSV file based translation service.
PHP
2
star
17

ESP8266AutoConnect

With this library an ESP8266 can automatically connect to an open wifi network which has a working internet connection. This library should not be considered save since it is a bad thing to have your iot autoconnect to everything it can get a hold of. However I developed it for a personal use case where exactly that was required. So here we go :)
C++
2
star
18

iban

This is a simple class to calculate the iban of a given account number, bank sort code and country code.
PHP
2
star
19

apache-add-site

This script is designed to setup any local development website witch one easy command. It creates if it doesn't exists an apache2 site config file, does the required hosts entry, adds the site to the apache configuration (a2ensite) and reloads the whole configuration. So you can get started within seconds.
Shell
2
star
20

juck

This program attempts to harvest as much information as possible from javascript source maps. Works with both, local files and urls.
Go
1
star
21

twitter-bot

Feed your Twitter account with lots of stuff - all you need is a RSS feed
PHP
1
star
22

hd

Check a single or many targets how they behave if an altered host header is supplied.
Go
1
star
23

laravel-geoip

Laravel-GeoIP provides you with the ability to gather open source ip intelligence by using the open api provided by https://github.com/Webklex/gogeoip
PHP
1
star
24

helpers

This is a helpers package that provides some built in helpers, and also provides an Artisan generator to quickly create your own custom helpers.
PHP
1
star
25

tcpc

A simple, single threaded and minimalistic port checker.
Rust
1
star
26

php-imap-documentation

php-imap and laravel-imap documentation
1
star
27

composer-info

Access the current details of your composer.lock file.
PHP
1
star
28

sstb

This bot will monitor all user orders for a given number of markets and will automatically create counter orders whenever one of these monitored orders gets fulfilled.
Go
1
star
29

2fam

Generate a 2fa code for a given secret.
Shell
1
star