# Service to Send Mail Through - Amazon SES - FIXED FOR ME!!!!

**URL:** https://forum.mautic.org/t/service-to-send-mail-through-amazon-ses-fixed-for-me/9144
**Category:** Product Support
**Created:** [August 2, 2017, 10:32pm UTC](https://forum.mautic.org/t/service-to-send-mail-through-amazon-ses-fixed-for-me/9144 "2017-08-02T22:32:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)
#### Post date: [August 2, 2017, 10:32pm UTC](https://forum.mautic.org/t/service-to-send-mail-through-amazon-ses-fixed-for-me/9144/1 "2017-08-02T22:32:27Z")

</div>

So like a lot of other people on the forum, I have been struggling with trying to set up Bounce Monitoring with SES.  
  
  
  
The problem, I could not get Amazon SES configured properly. I could configure it using Other SMTP Settings but that did  
  
not work with the Inbox Monitoring at all…  
  
  
  
When I started trying a couple days ago, I would get this message:  
  
  
  
Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] Log data: ++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] (code: 0)  
  
++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] (code: 0)  
  
  
  
So here are the things I had tried/checked:  
  
  
  
-Verify the following ports were opened: 25, 465 and 587  
  
-Verified, reverified, re-reverified my SES/SNS settings were configured properly  
  
-Whitelisted Amazon and all Amazon servers  
  
-Disabled SMTP Restrictions (this worked for someone in the forum, not for me LOL)  
  
  
  
So after spending a couple days going back and forth with my hosting support they finally came up with this answer:  
  
  
  
“Hello Jim,  
  
It appears that the config.php file is being ignored. That’s the reason why our firewall was blocking the connection. We have ports 25, 465 and 587 enabled on our servers.  
  
I have reviewed the file /home/leadmdsc/public\_html/mautic/app/bundles/EmailBundle/Swiftmailer/Transport/AmazonTransport.php and found the following constructor:  
  
  
  
==================================================================  
  
public function \_\_construct($host, Http $httpClient)  
  
{  
  
parent::\_\_construct($host, 2587, ‘tls’);  
  
==================================================================  
  
  
  
As you can see Swiftmailer forces the connection to Amazon over port 2587 with TLS. Whatever you add to your config.php file will be ignored.  
  
I have enabled that port in our firewall and now it’s working.”  
  
  
  
Viola…all good now. Contact emails that bounce are now automatically marked “Email Bounced”.  
  
  
  
So as you are troubleshooting this issue, make sure you get port 2587 opened. Hope this helps someone.  
  
  
  
Thanks,  
  
Jim

---

<div class="post-metadata">

### Author: ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)
#### Post date: [August 2, 2017, 10:32pm UTC](https://forum.mautic.org/t/service-to-send-mail-through-amazon-ses-fixed-for-me/9144/2 "2017-08-02T22:32:27Z")

</div>

So like a lot of other people on the forum, I have been struggling with trying to set up Bounce Monitoring with SES.

The problem, I could not get Amazon SES configured properly. I could configure it using Other SMTP Settings but that did  
not work with the Inbox Monitoring at all…

When I started trying a couple days ago, I would get this message:

Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] Log data: ++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] (code: 0)  
++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection refused #111] (code: 0)

So here are the things I had tried/checked:

-Verify the following ports were opened: 25, 465 and 587  
-Verified, reverified, re-reverified my SES/SNS settings were configured properly  
-Whitelisted Amazon and all Amazon servers  
-Disabled SMTP Restrictions (this worked for someone in the forum, not for me LOL)

So after spending a couple days going back and forth with my hosting support they finally came up with this answer:

"Hello Jim,  
It appears that the config.php file is being ignored. That’s the reason why our firewall was blocking the connection. We have ports 25, 465 and 587 enabled on our servers.  
I have reviewed the file /home/leadmdsc/public\_html/mautic/app/bundles/EmailBundle/Swiftmailer/Transport/AmazonTransport.php and found the following constructor:

# ================================================================== public function \_\_construct($host, Http $httpClient) { parent::\_\_construct($host, 2587, ‘tls’);

As you can see Swiftmailer forces the connection to Amazon over port 2587 with TLS. Whatever you add to your config.php file will be ignored.  
I have enabled that port in our firewall and now it’s working."

Viola…all good now. Contact emails that bounce are now automatically marked “Email Bounced”.

So as you are troubleshooting this issue, make sure you get port 2587 opened. Hope this helps someone.

Thanks,  
Jim

---

<div class="post-metadata">

### Author: ![sergiyb](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@sergiyb](https://forum.mautic.org/u/sergiyb)
#### Post date: [October 25, 2017, 10:11pm UTC](https://forum.mautic.org/t/service-to-send-mail-through-amazon-ses-fixed-for-me/9144/3 "2017-10-25T22:11:41Z")

</div>

Dude, I cannot thank you enough for this! Worked like a charm.  
I do wonder though - why is Mautic setup for a port 2587 when Amazon is recommending 25, 465 or 587? Should this be reported as a bug?
