PHPackages                             tsfcorp/email - 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. tsfcorp/email

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

tsfcorp/email
=============

Laravel package for sending emails

v10.0.2(2mo ago)03.2k↓50%MITPHPPHP ^8.0.2CI failing

Since Dec 10Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/thesoftwarefarm/email)[ Packagist](https://packagist.org/packages/tsfcorp/email)[ RSS](/packages/tsfcorp-email/feed)WikiDiscussions 10.x Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (64)Used By (0)

Library for sending emails - Laravel
====================================

[](#library-for-sending-emails---laravel)

Fluent interface for composing and sending emails

This package was designed to work in a standalone project or in a cluster of projects which push messages into a master project/database which act as a collector.

If you use this package in cluster mode, make sure the process `php artisan emails:dispatch-jobs` is running on master project. This can be kept alive with `supervisor`

Upgrade from 9.x to 10.x
========================

[](#upgrade-from-9x-to-10x)

- Attachment::path method was removed
- Attachment::disk method was removed

To create a new attachment use

```
new Attachment(
    path: 'file path',
    name: 'file name'
    disk: 'disk',
);
```

Upgrade from 8.x to 9.x
=======================

[](#upgrade-from-8x-to-9x)

Amazon SES default webhooks configuration under Identity is no longer supported. Switch to configuration sets

- add a new column to emails table called "metadata" TEXT nullable

Upgrade from 7.x to 8.x
=======================

[](#upgrade-from-7x-to-8x)

- `addAttachment` method signature was changed to `addAttachment(TsfCorp\Email\Attachment $attachment)`. This object can be constructed via

```
use TsfCorp\Email\Attachment;

$attachment = Attachment::path('/path/to/file.txt');
$attachment = Attachment::path('/path/to/file.txt', 'custom_name.txt');
$attachment = Attachment::disk('s3')->setPath('/path/to/file.txt');
$attachment = Attachment::disk('s3')->setPath('/path/to/file.txt', 'custom_name.txt');
```

Upgrade from 6.x to 7.x
=======================

[](#upgrade-from-6x-to-7x)

- `to` `cc`, `bcc` and `bounces_count` columns have been removed from the `emails` table.
- a new table was introduced, called `email_recipients`.
- `email_bounces` table removed
- new `webhook_secret` config value was added

In order to migrate older emails to the new structure, you have to:

1. publish the new migration file for `email_recipients` and run the migration
2. build a script which loops through current emails and insert the recipients for to, cc and bcc and execute it
3. create a migration which should drop to, cc, bcc and bounces\_count columns
4. create a migration which removes the email\_bounces table

Upgrade from 5.x to 6.x
=======================

[](#upgrade-from-5x-to-6x)

- This package now works only on laravel 9.x and php 8. For laravel 8.x and lower use previous versions.

Upgrade from 4.x to 5.x
=======================

[](#upgrade-from-4x-to-5x)

- dropped database\_connection from config. Use `setConnection()` when creating a new email to save the email on a different database connection
- EmailModel should no longer be used in userland. Create your own model which extends EmailModel

Upgrade from 3.x to 4.x
=======================

[](#upgrade-from-3x-to-4x)

- add a new TEXT "reply\_to" nullable column in emails table

Upgrade from 2.x to 3.x
=======================

[](#upgrade-from-2x-to-3x)

- add a new "uuid" column in emails table
- addAttachments(...$file\_paths) method was removed

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer. Run the following command:

```
composer require tsfcorp/email
```

After updating composer, the service provider will automatically be registered and enabled using Auto-Discovery

If your Laravel version is less than 5.5, make sure you add the service provider within `app.php` config file.

```
'providers' => [
    // ...
    TsfCorp\Email\EmailServiceProvider::class,
];
```

Next step is to run the artisan command to install config file and optionally migration file. The command will guide you through the process.

```
php artisan email:install
```

Update `config/email.php` with your settings.

### Requirements

[](#requirements)

This package makes use of Laravel Queues/Jobs to send emails. Make sure the queue system is configured properly

Usage Instructions
==================

[](#usage-instructions)

```
use TsfCorp\Email\Email;
use TsfCorp\Email\Attachment;

$email = (new Email())
    ->to('to@mail.com')
    ->cc('cc@mail.com')
    ->bcc('bcc@mail.com')
    ->subject('Hi')
    ->body('Hi there!')
    ->addAttachment(Attachment::path('/path/to/file.txt'));
```

Use `enqueue()` method to save the message in database without sending. Useful when you want to just save the message but delay sending. Or when `database_connection` config value is another database and sending is performed from there.

```
$email->enqueue();
```

Save the message and schedule a job to send the email

```
$email->enqueue()->dispatch();
```

Email Providers
===============

[](#email-providers)

- Mailgun
- Amazon SES
- Google SMTP

```
Note 1: In order to use Google SMTP you need at least PHP 7.1.3 and also require symfony/google-mailer in your composer.json
Note 2: If your Google Account has 2FA enabled you need to generate an "App Password" in your Google Acccount

```

Bounce Webhooks
===============

[](#bounce-webhooks)

If an email could not be sent to a recipient, the email provider can notify you about this. This package handles permanent failures webhooks for you.

#### Mailgun

[](#mailgun)

Add `http://app.example/webhook-mailgun` link to "Permanent Failure" section within you mailgun webhooks settings.

#### Amazon SES

[](#amazon-ses)

1. Create a new topic under Amazon SNS
2. Create a new subscription under the topic created above where you specify `http://app.example/webhook-ses` as endpoint
3. After the subscription was created, AWS will make a post request to specified endpoint with an URL which should be used to confirm subscription. That url can be found in app logs. Copy and paste that in browser.
4. Create a configuration set
5. After the configuration set was created, configure Event Destination and select Amazon SNS where you select the topic created at step 1.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 72.2% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~43 days

Recently: every ~16 days

Total

63

Last Release

61d ago

Major Versions

v6.0.2 → v7.0.02023-06-01

v7.0.4 → 8.x-dev2023-11-20

v8.0.0 → v9.0.02024-04-30

v6.0.4 → v9.0.42024-08-09

v6.0.5 → v10.0.02026-01-21

PHP version history (3 changes)v0.0.1PHP &gt;=5.5.9

v2.0.0PHP &gt;=7.2.5

v6.0.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d64b5544beade37e7660b482f79936ee03ee094e3599f9883ea2fb5848d7fe8c?d=identicon)[tsfcorp](/maintainers/tsfcorp)

---

Top Contributors

[![ionutantohi](https://avatars.githubusercontent.com/u/4609521?v=4)](https://github.com/ionutantohi "ionutantohi (52 commits)")[![Staneloo](https://avatars.githubusercontent.com/u/81114409?v=4)](https://github.com/Staneloo "Staneloo (9 commits)")[![sescu10](https://avatars.githubusercontent.com/u/9623798?v=4)](https://github.com/sescu10 "sescu10 (7 commits)")[![marianperca](https://avatars.githubusercontent.com/u/673596?v=4)](https://github.com/marianperca "marianperca (3 commits)")[![dragosperca](https://avatars.githubusercontent.com/u/4508543?v=4)](https://github.com/dragosperca "dragosperca (1 commits)")

### Embed Badge

![Health badge](/badges/tsfcorp-email/health.svg)

```
[![Health](https://phpackages.com/badges/tsfcorp-email/health.svg)](https://phpackages.com/packages/tsfcorp-email)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[spatie/laravel-mailcoach-ses-feedback

Process feedback for email campaigns sent using Amazon SES

1415.7k1](/packages/spatie-laravel-mailcoach-ses-feedback)

PHPackages © 2026

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