PHPackages                             newsman/laravel-newsman-smtp - 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. newsman/laravel-newsman-smtp

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

newsman/laravel-newsman-smtp
============================

Laravel mail transport driver for NewsMAN SMTP

v1.0.0(9mo ago)02MITPHPPHP ^8.1

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/Newsman/laravel-newsman-smtp)[ Packagist](https://packagist.org/packages/newsman/laravel-newsman-smtp)[ RSS](/packages/newsman-laravel-newsman-smtp/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel NewsMAN SMTP Driver
===========================

[](#laravel-newsman-smtp-driver)

A custom **Laravel** mail driver for [NewsMAN](https://www.newsman.com/) via the **SMTP API** (`message.send_raw` endpoint).
This driver sends the **full MIME message** generated by Laravel/Symfony (headers, HTML/text parts, attachments, inline images) without extra transformations.

> Vendor: `newsman` • Package: `laravel-newsman-smtp`

---

✨ Features
----------

[](#-features)

- Custom Symfony Mailer transport: `newsman`
- **Interactive setup** (no need to edit `.env`)
- Global `from_address` / `from_name` configuration
- Dedicated logging channel with request/response and **sensitive data redacted**
- Artisan commands for setup, testing, and uninstall
- Auto-injects into `config('mail.mailers')` (no manual config edits)

---

📦 Requirements
--------------

[](#-requirements)

- PHP **8.1+**
- Laravel **10.x / 11.x**
- Typical PHP extensions (mbstring, json, etc.)

---

🚀 Installation
--------------

[](#-installation)

```
composer require newsman/laravel-newsman-smtp
```

---

🛠️ Setup (no `.env` needed)
---------------------------

[](#️-setup-no-env-needed)

Run interactive setup (stores credentials in `storage/app/newsman/credentials.php` and sets `from_*`):

```
php artisan newsman:setup
# Prompts: Account ID, API Key, From address, From name
```

Clear caches (the setup command already does this, but you can run manually if needed):

```
php artisan config:clear
php artisan cache:clear
```

---

✉️ Usage
--------

[](#️-usage)

### A) Quick test (plain text)

[](#a-quick-test-plain-text)

```
php artisan newsman:test you@example.com
```

### B) Send HTML directly

[](#b-send-html-directly)

```
Mail::mailer('newsman')->html('HelloThis is HTML!', function ($m) {
    $m->to('you@example.com')->subject('HTML test');
});
```

### C) Full Mailable (HTML + plain + attachment + inline image)

[](#c-full-mailable-html--plain--attachment--inline-image)

```
use Illuminate\Mail\Mailable;
use Symfony\Component\Mime\Email;

class InvoiceMail extends Mailable
{
    public function build()
    {
        return $this->subject('Your Invoice')
            ->view('emails.invoice')       // HTML view
            ->text('emails.invoice_plain') // Plain text view
            ->attach(storage_path('app/invoices/123.pdf'), [
                'as' => 'Invoice-123.pdf', 'mime' => 'application/pdf'
            ])
            ->withSymfonyMessage(function (Email $email) {
                $email->getHeaders()->addTextHeader('X-Track', 'invoice-123');
                $email->embedFromPath(public_path('logo.png'), 'logo_cid', 'image/png');
            });
    }
}
```

In HTML view:

```

```

> The driver sends the **raw MIME** to NewsMAN (`mime_message`), so HTML, text, attachments, and inline images are preserved.

---

🔧 Artisan Commands
------------------

[](#-artisan-commands)

- **Interactive setup** (API key, Account ID, From info):

    ```
    php artisan newsman:setup
    # Non-interactive options:
    # --account-id=... --api-key=... --from-address=... --from-name=... --endpoint=...
    ```
- **Send test email:**

    ```
    php artisan newsman:test you@example.com --subject="NewsMAN Test"
    ```
- **Uninstall (reset to smtp, clear storage and caches):**

    ```
    php artisan newsman:uninstall
    # Keep credentials if you plan to reinstall later:
    php artisan newsman:uninstall --keep
    ```

---

🧾 Logging
---------

[](#-logging)

The package adds a dedicated log channel: `storage/logs/newsman.log`.

- Logs **request** (endpoint, subject, recipients) and **response** (status, headers, body/json).
- Sensitive fields (`api_key`, `mime_message`) are **REDACTED**.

Config (`config/newsman.php`):

```
'log' => [
    'enabled'   => true,
    'channel'   => 'newsman',
    'level'     => 'info',
    'redact'    => ['api_key','mime_message'],
    'requests'  => true,
    'responses' => true,
],
'http' => [
    'timeout' => 15,
    'retry'   => ['times' => 2, 'sleep' => 200], // ms
    'debug'   => false, // if true → Guzzle debug logged to laravel.log
],
```

View logs:

```
tail -f storage/logs/newsman.log
```

---

🧹 Cache &amp; config
--------------------

[](#-cache--config)

After modifying credentials, endpoint, or logging:

```
php artisan config:clear
php artisan cache:clear
composer dump-autoload
```

---

🆘 Troubleshooting
-----------------

[](#-troubleshooting)

**Mailer `[newsman] is not defined`**

- Ensure the package is installed and provider registers:
    - `MailManager::extend('newsman', ...)`
    - `config('mail.mailers.newsman')` in `boot()`
- Run: ```
    php artisan config:clear && php artisan cache:clear
    ```
- Check in Tinker: ```
    config('mail.mailers')
    ```

    → should include `newsman`.

**From defaults to `no-reply@example.com`**

- Verify `storage/app/newsman/credentials.php` has `from_address`/`from_name`.
- In Tinker: ```
    config('newsman.from_address')
    config('mail.from')
    ```

**Error `AbstractTransport::$dispatcher must not be accessed before initialization`**

- Ensure your `NewsmanTransport` constructor calls: ```
    parent::__construct($dispatcher, $logger);
    ```

**Minimum-stability / cannot find version**

- Install with `dev-main` or tag a version (`v1.0.0`) and require with `^1.0`.

---

🧽 Uninstall
-----------

[](#-uninstall)

1. Reset to Laravel’s default mailer (`smtp`):

    ```
    php artisan newsman:uninstall
    ```
2. Remove the package:

    ```
    composer remove newsman/laravel-newsman-smtp
    ```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance55

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

298d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1543455?v=4)[Catalin Constantin](/maintainers/dazoot)[@dazoot](https://github.com/dazoot)

---

Top Contributors

[![AdiNZM](https://avatars.githubusercontent.com/u/97724768?v=4)](https://github.com/AdiNZM "AdiNZM (2 commits)")

### Embed Badge

![Health badge](/badges/newsman-laravel-newsman-smtp/health.svg)

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

###  Alternatives

[illuminate/mail

The Illuminate Mail package.

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

The Illuminate Notifications package.

513.1M1.1k](/packages/illuminate-notifications)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1712.2M11](/packages/eduardokum-laravel-mail-auto-embed)[mailersend/laravel-driver

MailerSend Laravel Driver

90875.7k9](/packages/mailersend-laravel-driver)

PHPackages © 2026

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