# How to avoid confirmation email going to spam when using gmail for business and Cloudflare?

**URL:** <https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274>\
**Category:** Developer help\
**Created:** [March 26, 2021, 9:34pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274 "2021-03-26T21:34:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigul](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sigul/32/12326_2.png) [@sigul](https://forum.ghost.org/u/sigul)\
**Post date:** [March 26, 2021, 9:34pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/1 "2021-03-26T21:34:30Z")

</div>

hi, I set up a self-hosted blog with ghost on digital ocean. everything works fine but emails going to spam. I have set it to [ghost.silviogulizia.com](http://ghost.silviogulizia.com) and my domain is managed by cloudflare. my domain uses a gmail for business, and I set mx for this in cloudflare. my emails (subscription confirmation request) are going to spam because of dkim missing in headers. I duplicated the mx and added them for [ghost.silviogulizia.com](http://ghost.silviogulizia.com).

now, reading the documentation seems I have to use mailgun or amazon ses, but since I am getting email I assume I can use gmail too.  
what I have to set to avoid spam?

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [March 27, 2021, 12:01am UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/2 "2021-03-27T00:01:06Z")

</div>

Afaik you can’t simply use Gmail SMTP.

I suggest you to configure Mailgun. It’s free for reasonable amount of emails, and has all necessary dkim/spf setttings so your emails won’t get into spam.

---

<div class="post-metadata">

**Author:** ![sigul](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sigul/32/12326_2.png) [@sigul](https://forum.ghost.org/u/sigul)\
**Post date:** [March 27, 2021, 9:38pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/3 "2021-03-27T21:38:19Z")

</div>

I see. Is it somehow mandatory to use Mailgun?

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [March 27, 2021, 9:52pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/4 "2021-03-27T21:52:45Z")

</div>

You can use any SMTP provider here, just make sure they provide DKIM/SPF records so your emails won’t fall into spam.

Mailgun is convenient option if you already use it for Members functionality.

---

<div class="post-metadata">

**Author:** ![sigul](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sigul/32/12326_2.png) [@sigul](https://forum.ghost.org/u/sigul)\
**Post date:** [March 27, 2021, 11:08pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/5 "2021-03-27T23:08:42Z")

</div>

Actually, it’s not clear to me the whole email thing. Right after setting up the installation, I have confirmation mail sent by noreply@mydomain. Those emails go to spam, not sure if because of my dna setup (I am using a subdomain and I just duplicated Google Mx from my domain) or if it’s because I didn’t setup anything inside ghost config file. Then we have members/newsletter that I just realized requires Mailgun.

Should I setup ghost to use gmail to send confirmation emails? And then mailgun for members? Can I / does it make sense use only Mailgun for everything (easier?)

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [March 27, 2021, 11:40pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/6 "2021-03-27T23:40:31Z")

</div>

For some reasons signup/confirmation/service emails are sent by smtp service while member emails can be only sent via Mailgun.

By default smtp service is configured to use nodemailer and send emails directly from your server. It doesn’t include anti-spam settings by default—that’s why your email went to the spam.

I suggest you to configure Mailgun to send confirmation emails. You can use any other SMTP provider as well. I’m not sure about Gmail, but you can try.

---

<div class="post-metadata">

**Author:** ![sigul](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sigul/32/12326_2.png) [@sigul](https://forum.ghost.org/u/sigul)\
**Post date:** [March 30, 2021, 9:48pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/7 "2021-03-30T21:48:21Z")

</div>

Once I setup Mailgun to send mail, can I still get messages at Gmail (or other mail service) and send from it?

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [March 30, 2021, 10:02pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/8 "2021-03-30T22:02:04Z")

</div>

Yes, you will be able to get your emails as soon as your DNS MX records are point to Gmail.

---

<div class="post-metadata">

**Author:** ![Meet\_Goti](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/meet_goti/32/32418_2.png) [@Meet\_Goti](https://forum.ghost.org/u/Meet_Goti)\
**Post date:** [October 2, 2024, 5:44pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/9 "2024-10-02T17:44:20Z")

</div>

I’m using mailgun and it’s still going to spam

---

<div class="post-metadata">

**Author:** ![jjackson](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@jjackson](https://forum.ghost.org/u/jjackson)\
**Post date:** [November 1, 2024, 9:05pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/10 "2024-11-01T21:05:07Z")

</div>

I’m having an issue where new members aren’t getting the confirmation email at all. Using Mailgun, and I have hosting through OnGloat. Any workarounds?

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [December 25, 2024, 1:52pm UTC](https://forum.ghost.org/t/how-to-avoid-confirmation-email-going-to-spam-when-using-gmail-for-business-and-cloudflare/21274/11 "2024-12-25T13:52:24Z")

</div>

Make sure you’ve setup the mailgun in a `config.production.json` properly:

```auto
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 465,
      "secureConnection": true,
      "auth": {
        "user": "postmaster@yourdomain.com",
        "pass": "mailgun-pass"
      }
    }
  },

```
