Mautic Community Forums

Error while integrating Amazon SES with Mautic

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 [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 [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 [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.

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

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


Good luck,
Joey

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.

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

Hi Joey,

It worked!!

Thanks a lot.

Shanbhag

Hi Julien,

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

Shanbhag

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

No problem.

How do I go about it?

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

Did it.
Have I done it right?
Thanks.

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 :frowning:

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?

@joeyk @Shanbhag
I also wanted to mention that i supmitted a PR #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.


1 Like

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.

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)

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.

1 Like

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.

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?

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.