# How to add an email service?

**URL:** <https://forum.getkirby.com/t/how-to-add-an-email-service/13185>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 5, 2019, 9:15am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185 "2019-03-05T09:15:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedroborges](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/pedroborges/32/7038_2.png) [@pedroborges](https://forum.getkirby.com/u/pedroborges)\
**Post date:** [March 5, 2019, 9:15am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185/1 "2019-03-05T09:15:36Z")

</div>

In Kirby 2 we had email services and could easily add new ones. In Kirby 3 I only see PHPMailer and it seems hardcoded in the `Kirby\Cms\App@email` method. I would like to know if it’s possible to switch the default mailer. I like using Mailgun instead of SMTP.

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [March 5, 2019, 9:26am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185/2 "2019-03-05T09:26:31Z")

</div>

you can not currently. phpmailer is hardwired.

> <https://github.com/getkirby/kirby/blob/master/src/Cms/App.php#L9>

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [March 5, 2019, 9:29am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185/3 "2019-03-05T09:29:42Z")

</div>

but like another member said on slack you should be able to set smtp and other options to connect to 3rd party services. i have not tried myself yet but will have to during next 2 weeks. if you get it working please post your results. thanks.  
[https://getkirby.com/docs/guide/emails#transport-configuration](https://getkirby.com/docs/guide/emails#transport-configuration)

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [March 5, 2019, 9:33am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185/4 "2019-03-05T09:33:09Z")

</div>

for mailgun probably something like this… see step 3… and use the values for kirbys config.

> **[Using Mailgun For SMTP Email Settings In ClickFunnels](https://help.clickfunnels.com/hc/en-us/articles/360006102813-Using-Mailgun-For-SMTP-Email-Settings-In-ClickFunnels)**
>
> Learn how to integrate your Mailgun SMTP in ClickFunnels to send emails through Actionetics and funnel automations.
> Why you would need this
> If you are looking to setup SMTP to use in Actionetics an...

---

<div class="post-metadata">

**Author:** ![pedroborges](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/pedroborges/32/7038_2.png) [@pedroborges](https://forum.getkirby.com/u/pedroborges)\
**Post date:** [March 6, 2019, 1:30am UTC](https://forum.getkirby.com/t/how-to-add-an-email-service/13185/5 "2019-03-06T01:30:15Z")

</div>

Thank you for pointing me in the right direction! This is the SMTP config that works with Mailgun:

```php
'email' => [
    'transport' => [
        'type' => 'smtp',
        'host' => 'smtp.mailgun.org',
        'port' => 587,
        'security' => 'tls',
        'auth' => true,
        'username' => 'postmaster@sandbox***.mailgun.org', // for local test
        'password' => '***', // provided in the domain information
    ],
],

```

The from email address must be one validated with Mailgun too.
