# Mailgun Works with different email

**URL:** <https://forum.ghost.org/t/mailgun-works-with-different-email/48240>\
**Category:** Self-hosting\
**Created:** [June 19, 2024, 7:00am UTC](https://forum.ghost.org/t/mailgun-works-with-different-email/48240 "2024-06-19T07:00:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinomarkio](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dinomarkio](https://forum.ghost.org/u/dinomarkio)\
**Post date:** [June 19, 2024, 7:00am UTC](https://forum.ghost.org/t/mailgun-works-with-different-email/48240/1 "2024-06-19T07:00:52Z")

</div>

Hi there,

I have a self-hosted subdomain install and working: **[blog.mydomain.com](http://blog.mydomain.com)**.

I had made all setup on mailgun as the following link:

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/#mail)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

I’ve setup all DNS records on cloudflare using the step by step process and created a mailgun domain: **[m.mydomain.com](http://m.mydomain.com)**.

I’ve setup the transaction SMTP on ghost:

```auto
"mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "host": "smtp.mailgun.org",
    "port": 465,
    "secure": true,
    "auth": {
      "user": "noreply@m.mydomain.com",
      "pass": "password"
    }
  }
},

```

**The transactional email works** , but is not the one i’ve config.  
Instead i’ve receive emails from [noreply@blog.mydomain.com](mailto:noreply@blog.mydomain.com).

And the important part is the message comes with a warning:

> This email has failed its domain’s authentication requirements. It may be spoofed or improperly forwarded.

Any ideas?

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [June 20, 2024, 11:54pm UTC](https://forum.ghost.org/t/mailgun-works-with-different-email/48240/2 "2024-06-20T23:54:54Z")

</div>

Did you put your Mailgun API key in the Ghost admin area for newsletters?

---

<div class="post-metadata">

**Author:** ![dinomarkio](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dinomarkio](https://forum.ghost.org/u/dinomarkio)\
**Post date:** [June 23, 2024, 6:31pm UTC](https://forum.ghost.org/t/mailgun-works-with-different-email/48240/3 "2024-06-23T18:31:22Z")

</div>

Hey… yes it is working.  
The thing is the email is not the one i’ve setup.

I’ve setup the email [noreply@m.mydomain.com](mailto:noreply@m.mydomain.com) on mailgun.  
On newsletter i’ve receive an email from [noreply@blog.mydomain.com](mailto:noreply@blog.mydomain.com).

What i understood is:

IF you are using a subdomain “ **blog**.mydomain” for your blog, i can NOT setup another subdomain “m” or “mg”.

I’ve solve the problem setting the subdomain “blog” on mailgun.

Now its working.  
Thanks.
