PHPackages                             safemailer/safemailer - 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. safemailer/safemailer

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

safemailer/safemailer
=====================

A Laravel package for secure email attachments with expiration

0.4(1y ago)3331MITPHPPHP ^8.2

Since Dec 23Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/webmavens/safemailer)[ Packagist](https://packagist.org/packages/safemailer/safemailer)[ RSS](/packages/safemailer-safemailer/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Laravel SafeMailer
==================

[](#laravel-safemailer)

A Laravel package for secure email attachments with expiration functionality.

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require safemailer/safemailer
```

2. Add your SafeMailer() API key to your `.env` file:

```
SAFEMAILER_API_KEY=your_api_key_here
```

3. Change MAIL\_MAILER to be "safemailer" and MAIL\_FROM\_ADDRESS to be your mail in your .env file:

```
MAIL_MAILER=safemailer
MAIL_FROM_ADDRESS=YOUR_SAFE_MAILER_LOGIN_MAIL
```

Advanced Usage
--------------

[](#advanced-usage)

1. To define a expiration for the email:

```
$expiresAt = 'one_time'; // or 'never' ('never' is default)

Mail::mailer('safemailer')
    ->to($user)
    ->send(new ExampleMail($expiresAt));
```

Pass Headers from ExampleMail:

```
use Illuminate\Mail\Mailables\Headers;

public function headers(): Headers
{
   return new Headers(
      text: [
            'X-SafeMailer-Expiration-Type' => $this->expirationType,
      ],
   );
}
```

### Available Methods

[](#available-methods)

FUTURE FEATURE: You can use all standard Laravel Mail attachment methods - SafeMailer will automatically secure them:

```
// Basic attachment
->attach('/path/to/file.pdf')

// With custom filename
->attach('/path/to/file.pdf', [
    'as' => 'document.pdf'
])

// Attach multiple files
->attach('/path/to/file1.pdf')
->attach('/path/to/file2.pdf')
```

Security
--------

[](#security)

- All attachments are stored securely on SafeMailer's servers
- Files are automatically deleted after the expiration period
- Each attachment gets a unique, secure download link
- Downloads can be tracked and monitored

Best Practices
--------------

[](#best-practices)

1. Always set appropriate expiration times for sensitive documents
2. Use environment variables for API keys
3. Monitor attachment downloads through the SafeMailer dashboard
4. Keep your SafeMailer package updated to the latest version

Troubleshooting
---------------

[](#troubleshooting)

Common issues and solutions:

1. **API Key Issues**

    - Ensure your API key is correctly set in the `.env` file
    - Check if the API key is active in your SafeMailer dashboard
2. **File Upload Errors**

    - Verify file permissions
    - Check file size limits
    - Ensure proper file paths
3. **Configuration Issues**

    - Run `php artisan config:clear` after updating configuration
    - Verify published config file exists

Demo Video
----------

[](#demo-video)

Watch the demo video to learn how to use this package:

[![Package demo](https://camo.githubusercontent.com/ef767219c07afb5935c2398d708b086c71db0e0db724c7bc85f9ed03e10e3990/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f565f665f475537503961492f302e6a7067)](https://www.youtube.com/watch?v=V_f_GU7P9aI)

👉 [Click here to watch on YouTube](https://youtu.be/V_f_GU7P9aI)

Support
-------

[](#support)

For additional support:

- Submit issues on GitHub
- Contact

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance59

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.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 ~36 days

Total

4

Last Release

449d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66283568?v=4)[Web Mavens](/maintainers/webmavens)[@webmavens](https://github.com/webmavens)

---

Top Contributors

[![ssr-1125](https://avatars.githubusercontent.com/u/192307220?v=4)](https://github.com/ssr-1125 "ssr-1125 (12 commits)")[![webmavensteam](https://avatars.githubusercontent.com/u/66576112?v=4)](https://github.com/webmavensteam "webmavensteam (4 commits)")[![sawan-webmavens](https://avatars.githubusercontent.com/u/456840?v=4)](https://github.com/sawan-webmavens "sawan-webmavens (3 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[jdavidbakr/mail-tracker

Logs and tracks all outgoing emails from Laravel

6231.3M1](/packages/jdavidbakr-mail-tracker)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[illuminate/mail

The Illuminate Mail package.

5910.6M501](/packages/illuminate-mail)[illuminate/notifications

The Illuminate Notifications package.

513.1M1.1k](/packages/illuminate-notifications)

PHPackages © 2026

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