PHPackages                             elhajouji5/php-laravel-mailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. elhajouji5/php-laravel-mailer

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

elhajouji5/php-laravel-mailer
=============================

php-laravel-mailer

04PHP

Since Mar 23Pushed 8y agoCompare

[ Source](https://github.com/elhajouji5/php-laravel-mailer)[ Packagist](https://packagist.org/packages/elhajouji5/php-laravel-mailer)[ RSS](/packages/elhajouji5-php-laravel-mailer/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

PHP/Laravel Mailer
==================

[](#phplaravel-mailer)

This package allows sending email to a list of contacts based on queue/job Laravel built-in APIs, it inculdes the following options:

```
Send to a list of contact
Wait a delay between sending each email
Send email notification when sending has started/finished

```

Guide
-----

[](#guide)

- Requirements
    - PHP &gt;= 7.1
    - Laravel &gt;= 5.5
    - Redis
    - SMTP or API to send email through
    - Laravel/horizon
    - A connected database to your project

Installation &amp; configuration
--------------------------------

[](#installation--configuration)

type the following commands respecting the same order as bellow:

```
composer require laravel/horizon

```

```
composer require elhajouji5/php-laravel-mailer

```

```
php artisan vendor:publish

```

type the number between brackets that matches **Devinweb\\phpLaravelMailer\\MailerServiceProvider** and hit enter
E.g:

```
  [1 ] Provider: Devinweb\phpLaravelMailer\MailerServiceProvider

```

and again

```
php artisan vendor:publish

```

type the number between brackets that matches **Laravel\\Horizon\\HorizonServiceProvider** hit enter
Then

```
php artisan migrate

```

Make sure the 3 *tables failed\_jobs, jobs and subscribers* have migrated

### *Feeding database (Optional)*

[](#feeding-database-optional)

Add contacts to subscribers table (People you want to send them emails in the future)
*This is the schema of subscribers table:*

```
    +------------+------------------+------+-----+---------+----------------+
    | Field      | Type             | Null | Key | Default | Extra          |
    +------------+------------------+------+-----+---------+----------------+
    | id         | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
    | name       | varchar(255)     | NO   |     | NULL    |                |
    | email      | varchar(255)     | NO   | UNI | NULL    |                |
    | created_at | timestamp        | YES  |     | NULL    |                |
    | updated_at | timestamp        | YES  |     | NULL    |                |
    +------------+------------------+------+-----+---------+----------------+

```

You can feed (insert records) your subscribers table as explained bellow:
Concerning ORM standard
use this namespace whereever you want it inside your controllers:

```
    use Elhajouji5\phpLaravelMailer\Models\Subscriber;
```

Fill the table in the regular way

```
$subscriber        = new Subscriber();
$subscriber->name  = "Somestring here";
$subscriber->email = "someemail@example.ext";
$subscriber->save();

// Or

Subscriber::create([
    "name"  => "Somestring here",
    "email" => "someemail@example.ext",
]);

```

Browse and manage (edit, delete ... ) your subscribers

```
// browse all
$subscribers = Subscriber::latest()->get();

// Find by $id
$subscriberX        = Subscriber::find($id);
$subscriberX->delete();

// Total number of subscribers
$numberOfSubscribers = Subscriber::count();

..
..
..

// Or without including the namespace

$subscribers = \DB::select("SELECT * FROM subscribers");
var_dump($subscribers);

```

Output:

```
    array:2 [
        0 => {
            "id": 3
            "name": "Somestring here"
            "email": "someemail1@example.ext"
            "created_at": "2018-03-23 14:11:07"
            "updated_at": "2018-03-23 14:11:07"
        }
        1 => {
            "id": 4
            "name": "Somestring here"
            "email": "someemail2@example.ext"
            "created_at": "2018-03-23 14:11:25"
            "updated_at": "2018-03-23 14:11:25"
        }
        ...
        ...
        ...
    ]
```

### Setting up the local machine

[](#setting-up-the-local-machine)

- Make this changes to .env file

    ###### *It's highly recommended to use redis driver for better performance*

    [](#its-highly-recommended-to-use-redis-driver-for-better-performance)

    ```
      - QUEUE_DRIVER=redis

    ```

    **Your Redis server credentials(Below are the default credentials)**

    ```
      - REDIS_HOST=127.0.0.1
      - REDIS_PASSWORD=null
      - REDIS_PORT=6379

    ```

    **Your SMTP credentials(Example)**

    ```
      - MAIL_DRIVER=smtp
      - MAIL_HOST=smtp.mailtrap.io
      - MAIL_PORT=2525
      - MAIL_USERNAME=null
      - MAIL_PASSWORD=null
      - MAIL_ENCRYPTION=null

    ```

How to use it
-------------

[](#how-to-use-it)

now your new service supposed to be set up and ready to use
you can try it by sending a get request to the following route:

```
[host]/send/{delay}/{sender name}/{sender email address}/{tag}

```

host: your domain
delay: seconds to wait between sending each email
sender name: the from name will appear in the header of the email
sender email address the email address will appear in the header of the email
tag: a simple string to distinguish your campaigns

Example:

```
http://dev.something.local/send/10/RESAL/serviceclient@resal.me/holiday

```

Once you've sent the request, run this command at the root of your project

```
php artisan horizon

```

You can watch the process of that job from this link

```
[host]/horizon

```

E.g:

For a deeper understanding of horizon package visit this [ link ](https://laravel.com/docs/5.5/horizon)

#### *Please feel free to share your opinion to improve this service* ...

[](#please-feel-free-to-share-your-opinion-to-improve-this-service-)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c49ac293d11a96f2ee98db837a8383f8032196ed0863841a6afdc1e60e26bf7?d=identicon)[elhajouji5@gmail.com](/maintainers/elhajouji5@gmail.com)

### Embed Badge

![Health badge](/badges/elhajouji5-php-laravel-mailer/health.svg)

```
[![Health](https://phpackages.com/badges/elhajouji5-php-laravel-mailer/health.svg)](https://phpackages.com/packages/elhajouji5-php-laravel-mailer)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
