# Troubleshooting Amazon AWS SES sending email via SMTP

**URL:** https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100
**Category:** Support
**Created:** [September 5, 2020, 9:07am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100 "2020-09-05T09:07:39Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 9:07am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/1 "2020-09-05T09:07:39Z")

</div>

I’m having trouble moving from SendGrid to Amazon SES.

Could someone kindly share their settings from `app.yml` or confirm mine are correct?

```plaintext
  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  DISCOURSE_SMTP_ADDRESS: email-smtp.eu-west-2.amazonaws.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: xxxxxxx
  DISCOURSE_SMTP_PASSWORD: "xxxxxxxxxx"
  DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
  DISCOURSE_SMTP_AUTHENTICATION: login
```

Is the auth parameter correct here?

Have I missed something?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [September 5, 2020, 9:11am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/2 "2020-09-05T09:11:51Z")

</div>

The domain is verified at SES, you don’t need the SMTP auth parameter.

Additionally, you may have to get your ses account out of sandbox if not already done and request a limit increase. The sandbox condition applies per-region

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 9:13am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/3 "2020-09-05T09:13:47Z")

</div>

Yes, confirmed the domain is verified and is in production mode and rate limits increased.

Everything else looks correct then? 🤔

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [September 5, 2020, 9:15am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/4 "2020-09-05T09:15:13Z")

</div>

Yes, other settings look correct to me.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 9:15am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/5 "2020-09-05T09:15:53Z")

</div>

And the password is ok being wrapped in “marks”?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [September 5, 2020, 9:16am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/6 "2020-09-05T09:16:22Z")

</div>

Yes, that should be fine too

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 9:18am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/7 "2020-09-05T09:18:24Z")

</div>

Hmmm…

Is there a way to test from command line?

I have rebuilt my app each time too.

Thanks for the quick replies 👍🏻

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 9:27am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/8 "2020-09-05T09:27:23Z")

</div>

And this also looks correct? (I commented out the auth line as you suggested)

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/3/f34ff5e68b18fe05cb78e96427e61063455665a6.png)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 3:54pm UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/9 "2020-09-05T15:54:28Z")

</div>

I’m still at a loss as to why no emails are being sent via AWS SES.

When I send a test email via the admin page of our Discourse it simply says ‘sent’. Trying a lost password request also goes through the motions correctly but no email ever arrives.

I don’t think SES logs, so can I can’t check to see if it’s even receiving the emails.

The only thing which may cause a problem is that our reply-to address is using a [gmail.com](http://gmail.com) account , rather than our site domain.

Has anyone run in to this combination / scenario before?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 5, 2020, 3:58pm UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/10 "2020-09-05T15:58:28Z")

</div>

> [@Richie](#):
>
> The only thing which may cause a problem is that our reply-to address is using a [gmail.com](http://gmail.com) account , rather than our site domain.

That’s the email address that will be in the from line. It needs to be an address in the domain that SES will send from. SES won’t send mail that pretends to be coming form gmail. You don’t have control over `gmail.com`, so SES won’t send mail with that in the from line. `notification_email` should be `something@yourverifieddomain`

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 5, 2020, 4:12pm UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/11 "2020-09-05T16:12:14Z")

</div>

I was wondering if it might be something like that.

My current SendGrid setup has been working for years and has the following:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/c/fc77cfca099da71721510d9e648ff5c1b4a860d9.jpeg)

Are you saying that what I’m trying to do simply isn’t possible in SES because of the reply-to address being on the [gmail.com](http://gmail.com) domain?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 6, 2020, 7:49am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/12 "2020-09-06T07:49:10Z")

</div>

The notification email is what’s in the from line, and yes, I am fairly certain that’s your problem. Did you try changing it?

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [September 7, 2020, 3:16am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/13 "2020-09-07T03:16:14Z")

</div>

> [@Richie](#):
>
> ```plaintext
> ## TODO: The SMTP mail server used to validate new accounts and send notifications
> DISCOURSE_SMTP_ADDRESS: email-smtp.eu-west-2.amazonaws.com
> DISCOURSE_SMTP_PORT: 587
> DISCOURSE_SMTP_USER_NAME: xxxxxxx
> DISCOURSE_SMTP_PASSWORD: "xxxxxxxxxx"
> DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
> DISCOURSE_SMTP_AUTHENTICATION: login
> 
> ```

I use SES as well and it works well for me. The only difference I can see in comparison is that the  
`DISCOURSE_SMTP_AUTHENTICATION: login` line does not exist in mine. Also that `DISCOURSE_SMTP_ENABLE_START_TLS: true` and `DISCOURSE_SMTP_PORT: 587` are both commented out, though that shouldn’t make a difference.

The only 3 lines that I modify in the app.yml is the SMTP address, username and password. The rest is commented out as-is from a fresh install and using defaults. After rebuild I just need to ensure that the site setting `notification email` is set to an address which uses a domain verified on SES. I don’t use quotes on the password anymore, but my older installs did and it worked fine either way.

Yeah would be worth trying changing the reply-to address to use an address using the verified SES domain as recommended in the above reply, just to test if that will make it send properly.

If it doesn’t work, I’d check if your host is blocking some ports and perhaps double check that the SES credentials were generated correctly. I see you’ve confirmed above that your domain is verified with SES.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [September 7, 2020, 9:49am UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/14 "2020-09-07T09:49:44Z")

</div>

Thanks for the detailed info @markersocial 👍🏻

Can I ask, is your “reply to” email address on a different domain from the the “From” address? 🤔

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [September 7, 2020, 3:22pm UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/15 "2020-09-07T15:22:22Z")

</div>

No worries 🙂

The reply to address is on the same domain as the from domain yeah, but on some instances it’s not the same subdomain (still the same root domain though). Both cases work fine for me.

---

<div class="post-metadata">

### Author: ![James\_Randall](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/james_randall/32/186050_2.png) [@James\_Randall](https://meta.discourse.org/u/James_Randall)
#### Post date: [September 9, 2020, 11:27pm UTC](https://meta.discourse.org/t/troubleshooting-amazon-aws-ses-sending-email-via-smtp/163100/16 "2020-09-09T23:27:46Z")

</div>

I’m sure that you caught this → have you verified the outgoing email address that discourse uses to send?  
If it is notify@yourverifieddomain, you need to go into SES, second row under ‘Identity Management’ and add then verify the sending email. Nothing goes out until you do this.  
No alarms, no sirens, just no go.

Having a gmail reply is great. That is what I did. Then members authorization emails were getting spam blocked because From and Reply didn’t match.

Eventually I wrote a simple AWS Lambda (took a week to learn how) that forwards incoming email to the Discourse API. Very clean. No POSTIX.
