PHPackages                             smtp2go-oss/smtp2go-laravel - 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. smtp2go-oss/smtp2go-laravel

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

smtp2go-oss/smtp2go-laravel
===========================

1.0.1(9mo ago)33.5k↓19.2%MITPHP

Since May 22Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/smtp2go-oss/smtp2go-laravel)[ Packagist](https://packagist.org/packages/smtp2go-oss/smtp2go-laravel)[ RSS](/packages/smtp2go-oss-smtp2go-laravel/feed)WikiDiscussions main Synced 1mo ago

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

Symfony Laravel SMTP2GO Mailer
==============================

[](#symfony-laravel-smtp2go-mailer)

This is a Laravel Service Provider for sending mail from a Laravel application via SMTP2GO. It should also work in Symfony applications due to Laravel's underlying dependency on Symfony mailer.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or higher
- SMTP2GO account

Install
-------

[](#install)

Install via composer: `composer require smtp2go-oss/smtp2go-laravel`

Setup - Laravel
---------------

[](#setup---laravel)

1. Set up environment variables:

Add the following entry to your `.env` file with your SMTP2GO api key.

`SMTP2GO_API_KEY=api-YOUR_API_KEY_HERE`

and change the existing `MAIL_MAILER` entry to `smtp2go`

`MAIL_MAILER=smtp2go`

2. Add the following entry to config/mail.php

```
'smtp2go' => [
            'key' => env('SMTP2GO_API_KEY'),
            'transport' => 'smtp2go',
        ]
```

Setup - Symfony
---------------

[](#setup---symfony)

1. Add the following to your `.env` file

```
SMTP2GO_API_KEY=api-YOUR_API_KEY_HERE
MAILER_DSN=SMTP2GO://${SMTP2GO_API_KEY}@default

```

2. If not already configured, import a services.php file in the `config/services.yaml` file

```
imports:
    - { resource: 'services.php' }

```

3. Setup `config/services.php`, example below...

```
