# Error while integrating Amazon SES with Mautic

**URL:** <https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390>\
**Category:** Product Support\
**Created:** [July 26, 2020, 12:28pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390 "2020-07-26T12:28:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [July 26, 2020, 12:28pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/1 "2020-07-26T12:28:35Z")

</div>

**Your software**  
My Mautic version is: 2.16.2  
My PHP version is: 7.3.17

**Your problem**  
My problem is: I am trying to integrate Amazon SES with Mautic.  
I have a new user for both Mautic & Amazon SES.  
My issue is, after I enter the Amazon SES username and password in their respective fields and click ‘Test Connection’ I get the following error message.

These errors are showing in the log:

“Connection could not be established with host [email-smtp.us-east-1.amazonaws.com](http://email-smtp.us-east-1.amazonaws.com) [Connection refused #111] Log data: ++ Starting Mautic\EmailBundle\Swiftmailer\Transport\AmazonTransport !! Connection could not be established with host [email-smtp.us-east-1.amazonaws.com](http://email-smtp.us-east-1.amazonaws.com) [Connection refused #111] (code: 0)  
++ Starting Mautic\EmailBundle\Swiftmailer\Transport\AmazonTransport !! Connection could not be established with host [email-smtp.us-east-1.amazonaws.com](http://email-smtp.us-east-1.amazonaws.com) [Connection refused #111] (code: 0)”

Steps I have tried to fix the problem:  
I have tried re-creating new users in Amazon SES and generating new usernames and passwords and also changing the Amazon SES Host a couple of times. But nothing has worked so far.

---

<div class="post-metadata">

**Author:** ![julien66](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/julien66/32/1033_2.png) [@julien66](https://forum.mautic.org/u/julien66)\
**Post date:** [August 12, 2020, 2:51am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/2 "2020-08-12T02:51:06Z")

</div>

@Shanbhag did you find a solution? I have the same issue with Mautic 3.0.2  
Thanks

---

<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:** [August 12, 2020, 6:53am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/3 "2020-08-12T06:53:56Z")

</div>

Hi,  
Could it be a port issue?  
If so, could you please check if the solution is this video helps you?

> **[Amazon SES is not working with Mautic - Joey Keller](http://joeykeller.com/knowledge-base/amazon-ses-is-not-working-with-mautic/)**
>
> If you are on a shared or strictly supervised server, it can happen, that you'll be unable to connect your amazon SES service with Mautic.

  
Good luck,  
Joey

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 2:39pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/4 "2020-08-12T14:39:46Z")

</div>

Hi Julien,

I haven’t found a solution yet.

Strangely, Amazon SES works fine with my website for sending out confirmation emails.  
I fail to understand why it doesn’t configure with mautic.

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 2:43pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/5 "2020-08-12T14:43:14Z")

</div>

Hi Joey,

Thanks for the link.  
I’ll go through and try to sort out the issue.

One thing I’d like to point out, though, is that Amazon SES works fine with my  
website (same server). I don’t know why it doesn’t configure with mautic.

Again, thanks for your help.  
Shanbhag

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 3:20pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/6 "2020-08-12T15:20:00Z")

</div>

Hi Joey,

It worked!!

Thanks a lot.

Shanbhag

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 3:20pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/7 "2020-08-12T15:20:47Z")

</div>

Hi Julien,

Joey’s video sorted the issue for me.  
Do give it a try.

Shanbhag

---

<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:** [August 12, 2020, 3:22pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/8 "2020-08-12T15:22:17Z")

</div>

Great! Can you set it as a Solution in your post?

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 3:23pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/9 "2020-08-12T15:23:31Z")

</div>

No problem.

How do I go about 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:** [August 12, 2020, 3:29pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/10 "2020-08-12T15:29:11Z")

</div>

I think you can click on a solution button maybe - maybe not. If not, don’t worry about it. 🙂 I’m happy it worked.

![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0ba0f2f380fd041a4d00b7a0ce8f134707cf20ef.png)

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 12, 2020, 3:50pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/11 "2020-08-12T15:50:57Z")

</div>

Did it.  
Have I done it right?  
Thanks.

---

<div class="post-metadata">

**Author:** ![julien66](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/julien66/32/1033_2.png) [@julien66](https://forum.mautic.org/u/julien66)\
**Post date:** [August 13, 2020, 1:41am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/12 "2020-08-13T01:41:38Z")

</div>

Thank you @joeyk and @Shanbhag. I had already checked the port 2587 and the usual SMTP ports, they are open on my VPS.

In my case, I realized the issue is intermittent: the connection to SES is working most of the time, either when clicking on Test Connection in the Email Settings page, or when emails are sent properly during a test campaign. But 15-25% of the times when Mautic attempts to send an email in a campaign or when clicking the Test Connection button, I receive the error message mentioned by @Shanbhag in the first post.  
So I’m really puzzled by the intermittent behavior of the issue. I searched this error message on non Mautic websites like Stack Overflow, but couldn’t find an hint. Most posts are related to opening the right port as Joey properly pointed out. Other than that I have no clue ☹

---

<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:** [August 13, 2020, 5:41am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/13 "2020-08-13T05:41:48Z")

</div>

Actually in the video I’m showing how to change the sending port manually.  
But if you have an issue ‘sometimes’ than it could be an issue with your VPS maybe?

---

<div class="post-metadata">

**Author:** ![Wise-Gorilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wise-gorilla/32/444_2.png) [@Wise-Gorilla](https://forum.mautic.org/u/Wise-Gorilla)\
**Post date:** [August 13, 2020, 10:28pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/14 "2020-08-13T22:28:52Z")

</div>

> [@julien66](#):
>
> n or when clicking the Test Connection button, I receive the error message mentioned by @Shanbhag in the fir

@joeyk @Shanbhag  
I also wanted to mention that i supmitted a PR [#9005](https://github.com/mautic/mautic/pull/9005) which is about to get merged with the upcoming Mautic 3.1 , Beside it allows you to use SES API which is usefull to speed up sending and can also be a solusion if SMTP ports are blocked on your server, it also allow to set a custom port for SES so you dont have to edit the port manually.

It would be nice if anyone test the PR to gurantee to be merged with Mautic 3.1 as planned this month.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9a11d3a0573362a3a53bf097a04df5644c875b75.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0ab2b7b66d38510728502b25f5b8d680bde8189d.png)

---

<div class="post-metadata">

**Author:** ![julien66](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/julien66/32/1033_2.png) [@julien66](https://forum.mautic.org/u/julien66)\
**Post date:** [August 13, 2020, 10:48pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/15 "2020-08-13T22:48:09Z")

</div>

Yes in this case it’s not a port issue because the mails go through properly 80-90% of the time.  
Will check the VPS.

---

<div class="post-metadata">

**Author:** ![julien66](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/julien66/32/1033_2.png) [@julien66](https://forum.mautic.org/u/julien66)\
**Post date:** [August 13, 2020, 10:54pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/16 "2020-08-13T22:54:04Z")

</div>

Thank you so much @Wise-Gorilla. That’s going to be a great feature to be able to use the API.

I’m not well versed enough in Mautic to test it personally though. (And honestly I would be afraid to break my installation with an unfixable error (not from your PR but just playing with the codebase), as it already happened to me)

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 14, 2020, 4:23am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/17 "2020-08-14T04:23:54Z")

</div>

Thank you @Wise-Gorilla for the update. That will be a good feature to have.  
I am in a similar situation to @julien66, meaning I am too new to mautic to tinker with my set-up.  
If anything goes wrong, I may not be able to set it right again soon.

@julien66 I hope you find the solution to your issue soon.

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 14, 2020, 12:07pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/18 "2020-08-14T12:07:09Z")

</div>

Hi @joeyk,

I followed your video and the configuration of AWS SES went fine.  
The error message disappeared and I got a “success” when I tested the connection.

Now, the issue is emails aren’t getting sent. Not even the test email.  
Mautic says “email sent” but the email doesn’t arrive.

I tried setting up a campaign to test the email sending and again the same issue. Mautic says “email sent” but no email arrives.

I know, this might be a different issue. and not related to the earlier problem.  
Any idea what the issue could be?

Is it a cron job issue?  
Thanks in advance.

---

<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:** [August 14, 2020, 4:35pm UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/19 "2020-08-14T16:35:27Z")

</div>

Hey, it can be multiple issues.  
Can you check if you see the email gone in your SES console? Is you SES statistics reflecting the number of emails you tried to send?  
Also: did you verify this email?  
You are out of sandbox, right?

---

<div class="post-metadata">

**Author:** ![Shanbhag](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shanbhag/32/1504_2.png) [@Shanbhag](https://forum.mautic.org/u/Shanbhag)\
**Post date:** [August 15, 2020, 4:33am UTC](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390/20 "2020-08-15T04:33:40Z")

</div>

Hey @joeyk , I have verified my domain and I am out of the sandbox. But you’re right I can’t see the emails in my SES console.

[Next page](https://forum.mautic.org/t/error-while-integrating-amazon-ses-with-mautic/15390.md?page=2)
