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

Abandoned → [smtp2go-oss/smtp2go-laravel](/?search=smtp2go-oss%2Fsmtp2go-laravel)Library[Mail &amp; Notifications](/categories/mail)

smtp2go-oss/smtp2go-symfony-laravel-transport
=============================================

0514PHP

Since Dec 16Pushed 1y ago2 watchersCompare

[ Source](https://github.com/2050nz/smtp2go-transport)[ Packagist](https://packagist.org/packages/smtp2go-oss/smtp2go-symfony-laravel-transport)[ RSS](/packages/smtp2go-oss-smtp2go-symfony-laravel-transport/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

This package is currently in BETA and is not recommended for use in production. Currently we are only testing in Laravel applications.
--------------------------------------------------------------------------------------------------------------------------------------

[](#this-package-is-currently-in-beta-and-is-not-recommended-for-use-in-production-currently-we-are-only-testing-in-laravel-applications)

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: `sh composer require smtp2go-oss/smtp2go-symfony-laravel-transport `

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. Update your config/mail.php file

```
'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...

```
