# Multiple SMTP settings for different mailing segments

**URL:** <https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446>\
**Category:** General Discussion\
**Created:** [March 5, 2021, 4:27am UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446 "2021-03-05T04:27:26Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![robertcooke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robertcooke/32/510_2.png) [@robertcooke](https://forum.mautic.org/u/robertcooke)\
**Post date:** [June 4, 2023, 1:37pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/21 "2023-06-04T13:37:08Z")

</div>

I don’t use tracking, but this can be easily implemented.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 4, 2023, 3:27pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/22 "2023-06-04T15:27:43Z")

</div>

Do you use images in emails?

---

<div class="post-metadata">

**Author:** ![robertcooke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robertcooke/32/510_2.png) [@robertcooke](https://forum.mautic.org/u/robertcooke)\
**Post date:** [June 4, 2023, 3:33pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/23 "2023-06-04T15:33:23Z")

</div>

No I use Mautic for my cold outreach and never use images or attachments etc… I do b2b outreach and my emails look like b2b plain text emails. I have been thinking of using a headshot in my signature, but haven’t done it yet.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 4, 2023, 7:06pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/24 "2023-06-04T19:06:57Z")

</div>

Oh I see.  
I found Mailwizz to be a lot more scalable them Mailwizz for this purpose. If you don’t use tracking anyway, then Mailwizz can do multi SMTP as a default. It’s a lot more scalable then Mautic for cold outreach since it’s more streamlined for that purpose.

---

<div class="post-metadata">

**Author:** ![robertcooke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robertcooke/32/510_2.png) [@robertcooke](https://forum.mautic.org/u/robertcooke)\
**Post date:** [June 4, 2023, 7:13pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/25 "2023-06-04T19:13:14Z")

</div>

I really like Mautic and now I got it working exactly the way I want it.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 4, 2023, 7:19pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/26 "2023-06-04T19:19:02Z")

</div>

Yeah, sounds great.  
Would you share your solution, is it open source?

---

<div class="post-metadata">

**Author:** ![robertcooke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robertcooke/32/510_2.png) [@robertcooke](https://forum.mautic.org/u/robertcooke)\
**Post date:** [June 17, 2023, 3:03am UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/28 "2023-06-17T03:03:41Z")

</div>

No, but I am open to partner with someone that wants to open source it or build a service on top of this. I’m in cold outreach, but this is also very useful for email blasting.

---

<div class="post-metadata">

**Author:** ![dross](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dross/32/10015_2.png) [@dross](https://forum.mautic.org/u/dross)\
**Post date:** [January 14, 2024, 1:01pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/29 "2024-01-14T13:01:27Z")

</div>

Sorry to update this old post but Im looking for a solution where each owner will send with their own SMTP.

Is this viable ATM with some plugin? Or someone can point me with similar plugins as examples on how to extend it so my team starts the Dev?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [January 14, 2024, 1:20pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/30 "2024-01-14T13:20:48Z")

</div>

I do not see any reason why this would not be possible, just have to make some modifications to transport and of course ability to somehow save the necessary details for sending for eah owner.

I believe if you check my plugin for Multi mailgun domain you can get the idea what directions should the implementation go.

---

<div class="post-metadata">

**Author:** ![fneuhold](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fneuhold/32/11357_2.png) [@fneuhold](https://forum.mautic.org/u/fneuhold)\
**Post date:** [January 29, 2024, 12:52pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/31 "2024-01-29T12:52:57Z")

</div>

Wait, by using Mautic and something like Postal can this offer unlimited cold email sends? I’m new to Mautic and open source projects in general. I’ve been messing around with Gmail for some mass mail but seems to have some pretty crappy limitations

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 29, 2024, 2:28pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/32 "2024-01-29T14:28:50Z")

</div>

Hi, this was already answered in the other post.

You can send out as many emails as you want.

Unlimited.

For free.

But if you don’t know how to maintain and grow reputatoin with Postal, then it doesn’t matter how many emails you are sending, you’ll end up sending only 500 emails, and the rest goes to spam from that day on.

Forever.

So you will end up not sending email emails at all.

Please don’t beleive these clickbaity videos, that make empty promises.

There is no such a thing as free unlimited email.

---

<div class="post-metadata">

**Author:** ![miki](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/miki/32/12678_2.png) [@miki](https://forum.mautic.org/u/miki)\
**Post date:** [February 5, 2025, 12:48pm UTC](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446/33 "2025-02-05T12:48:41Z")

</div>

Actually if you could modify the code, it’s quite easy to have this feature .

The easiest way to create a new plugin.

1. In the services.php you should define an alternative transport (or more)

```auto
   $services->set('mailer.alternative_transport', \Symfony\Component\Mailer\Transport\TransportInterface::class)        
        ->factory([\Mautic\EmailBundle\Mailer\Transport\TransportFactory::class, 'fromString'])
        ->args([getenv('MY_ALTERNATIVE_EMAIL_DSN')])
        ->alias(\Symfony\Component\Mailer\Transport\TransportInterface::class, 'mailer.alternative_transport');

```

1. You need a new event subscriber which subscribes to the EmailEvents::EMAIL\_ON\_SEND event.

```auto
return [           
            EmailEvents::EMAIL_ON_SEND => [['setTransport', 0],
            ],            
        ];

```

In the event handler function you can reach all the Email and the Lead related parameters. (email category, email tag, lead email, lead email domain, lead company, etc.) So based on your needs, you can say for example:

```auto
public function setTransport(EmailSendEvent $event): void
{
    if (strtolower($event->getEmail()->getCategory()->getAlias()) === 'important_category') {
        putenv('USE_ALTERNATIVE_TRANSPORT=mailer.alternative_transport');
    }
}

```

1. You have to modify the /app/bundles/EmailBundle/Helper/MailHelper.php class`s send function.

Before anything you have to use this code:

```auto
    if (false !== getenv('USE_ALTERNATIVE_TRANSPORT') && false === empty(getenv('USE_ALTERNATIVE_TRANSPORT'))) {
        // Use the alternative transport
        $this->transport = $this->factory->get(getenv('USE_ALTERNATIVE_TRANSPORT'));
        // Reinitialize the mailer with the selected transport
        $class = get_class($this->mailer);
        $this->mailer = new $class($this->transport);
        // reset the environmental variable
        putenv('USE_ALTERNATIVE_TRANSPORT=');
    }

```

I didn’ want to modify the MailHelper, but this is the fastest way I could use multiple DSNs.

[Previous page](https://forum.mautic.org/t/multiple-smtp-settings-for-different-mailing-segments/18446.md?page=1)
