PHPackages                             gylaandrij/swiftmailer-mailgun-bundle - 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. gylaandrij/swiftmailer-mailgun-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

gylaandrij/swiftmailer-mailgun-bundle
=====================================

Swiftmailer Mailgun bundle

2.0.0(8y ago)12.6kMITPHPPHP ^7.0

Since Aug 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gulaandrij/swiftmailer-mailgun-bundle)[ Packagist](https://packagist.org/packages/gylaandrij/swiftmailer-mailgun-bundle)[ Docs](https://github.com/gulaandrij/swiftmailer-mailgun-bundle)[ RSS](/packages/gylaandrij-swiftmailer-mailgun-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (12)Versions (10)Used By (0)

Swiftmailer Mailgun bundle
==========================

[](#swiftmailer-mailgun-bundle)

This bundle adds an extra transport to the swiftmailer service that uses the mailgun http interface for sending messages.

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

[](#installation)

```
composer require gylaandrij/swiftmailer-mailgun-bundle php-http/guzzle5-adapter
```

*Note: You can use any of [these adapters](https://packagist.org/providers/php-http/client-implementation)*

Also add to your AppKernel:

```
new cspoo\Swiftmailer\MailgunBundle\cspooSwiftmailerMailgunBundle(),
```

Configure your application with the credentials you find on the [domain overview](https://mailgun.com/app/domains) on the Mailgun.com dashboard.

```
// app/config/config.yml:
cspoo_swiftmailer_mailgun:
    key: "key-xxxxxxxxxx"
    domain: "mydomain.com"
    http_client: 'httplug.client' # Optional. Defaults to null and uses discovery to find client.

# Swiftmailer Configuration
swiftmailer:
    transport: "mailgun"
    spool:     { type: memory } # This will start sending emails on kernel.terminate event
```

Note that the swiftmailer configuration is the same as the standard one - you just change the mailer\_transport parameter.

Usage
-----

[](#usage)

First craft a message:

```
$message = \Swift_Message::newInstance()
        ->setSubject('Hello Email')
        ->setFrom('send@example.com')
        ->setTo('recipient@example.com')
        ->setBody(
            $this->renderView(
                'HelloBundle:Hello:email.txt.twig',
                array('name' => $name)
            )
        )
    ;
```

Then send it as you normally would with the `mailer` service. Your configuration ensures that you will be using the Mailgun transport.

```
$this->container->get('mailer')->send($message);
```

Choose HTTP client
------------------

[](#choose-http-client)

Mailgun 2.0 is no longer coupled to Guzzle5. Thanks to [Httplug](http://docs.php-http.org/en/latest/index.html) you can now use any library to transport HTTP messages. You can rely on [discovery](http://docs.php-http.org/en/latest/discovery.html) to automatically find an installed client or you can use [HttplugBundle](https://github.com/php-http/HttplugBundle) and provide a client service name to the mailgun configuration.

```
// app/config/config.yml:
cspoo_swiftmailer_mailgun:
    http_client: 'httplug.client'
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 68.1% 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 ~162 days

Recently: every ~200 days

Total

9

Last Release

2980d ago

Major Versions

0.4.0 → 1.0.02017-10-21

1.0.0 → 2.0.02018-03-22

PHP version history (6 changes)0.1.0PHP &gt;=5.3.2

0.2.0PHP &gt;=5.3

0.3.1PHP ^5.5|^7.0

0.4.0PHP ^5.5 || ^7.0

1.0.0PHP &gt;=7.0.0

2.0.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/052561cd33ec8c827e577126b002d23624c0cb0592ac504ad79fce078fc2c15d?d=identicon)[gulaandrij](/maintainers/gulaandrij)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (32 commits)")[![tehplague](https://avatars.githubusercontent.com/u/1062568?v=4)](https://github.com/tehplague "tehplague (8 commits)")[![gulaandrij](https://avatars.githubusercontent.com/u/2658746?v=4)](https://github.com/gulaandrij "gulaandrij (3 commits)")[![mattattui](https://avatars.githubusercontent.com/u/93214?v=4)](https://github.com/mattattui "mattattui (1 commits)")[![drmjo](https://avatars.githubusercontent.com/u/1946791?v=4)](https://github.com/drmjo "drmjo (1 commits)")[![rcwsr](https://avatars.githubusercontent.com/u/1541207?v=4)](https://github.com/rcwsr "rcwsr (1 commits)")[![tristanbes](https://avatars.githubusercontent.com/u/346010?v=4)](https://github.com/tristanbes "tristanbes (1 commits)")

---

Tags

symfonymailgune-mailswiftmailer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/gylaandrij-swiftmailer-mailgun-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gylaandrij-swiftmailer-mailgun-bundle/health.svg)](https://phpackages.com/packages/gylaandrij-swiftmailer-mailgun-bundle)
```

###  Alternatives

[cspoo/swiftmailer-mailgun-bundle

Swiftmailer Mailgun bundle

1031.1M](/packages/cspoo-swiftmailer-mailgun-bundle)[php-flasher/flasher-symfony

Integrate flash notifications into Symfony projects effortlessly with PHPFlasher. Improve user experience and application feedback loops easily.

141.3M20](/packages/php-flasher-flasher-symfony)[stampie/stampie-bundle

This bundle provides integration for Stampie Email Library

25222.1k](/packages/stampie-stampie-bundle)[tss/automailer-bundle

Adds Doctrine spool to Swiftmailer

1144.1k](/packages/tss-automailer-bundle)[azine/mailgunwebhooks-bundle

Symfony2 Bundle to easily capture feedback from mailgun.com via their provided webhooks

104.1k](/packages/azine-mailgunwebhooks-bundle)

PHPackages © 2026

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