# Ghost Labs: Mailgun domain and API

**URL:** <https://forum.ghost.org/t/ghost-labs-mailgun-domain-and-api/10979>\
**Category:** Memberships & subscriptions\
**Created:** [December 26, 2019, 2:13pm UTC](https://forum.ghost.org/t/ghost-labs-mailgun-domain-and-api/10979 "2019-12-26T14:13:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![joncojonathan](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joncojonathan](https://forum.ghost.org/u/joncojonathan)\
**Post date:** [April 25, 2020, 12:38pm UTC](https://forum.ghost.org/t/ghost-labs-mailgun-domain-and-api/10979/6 "2020-04-25T12:38:29Z")

</div>

Hello,

I have now tested Mailgun using the command line on my server:

```bash
curl -s --user 'api:redacted-aaaaaaaa-aaaaaaaa' https://api.eu.mailgun.net/v3/blog.example.org.uk/messages -F from='Blog <noreply@blog.example.org.uk>' -F to=me@example.org.uk -F subject='Testing from SSH' -F text='Testing mailgun from Blog server.'

```

The email is correctly delivered.

The problem only seems to be when sending emails via the members feature. Specifically the “Email Newsletter \> send test email” function.

The Ghost log shows:

> {“name”:“Log”,“hostname”:“blog-server”,“pid”:12337,“level”:30,“req”:{“meta”:{“requestId”:“a5651543-7627-44f7-88e9-09a341881798”,“userId”:“5”},“url”:“/email\_preview/posts/redacted/”,“method”:“POST”,“originalUrl”:“/ghost/api/v3/admin/email\_preview/posts/redacted/”,“params”:{“id”:“redacted”},“headers”:{“host”:“[blog.example.org.uk](http://blog.example.org.uk)”,“x-forwarded-proto”:“https”,“x-real-ip”:“redacted”,“x-forwarded-for”:“redacted, redacted”,“connection”:“close”,“content-length”:“38”,“accept-encoding”:“gzip”,“cf-ray”:“1354198b9ebc6a83-LHR”,“cf-visitor”:“{"scheme":"https"}”,“user-agent”:“Mozilla/5.0 (X11; Linux x86\_64; rv:75.0) Gecko/20100101 Firefox/75.0”,“accept”:“application/json, text/javascript, _/_; q=0.01”,“accept-language”:“en-GB”,“referer”:“[https://blog.example.org.uk/ghost/",“content-type”:"application/json](https://blog.example.org.uk/ghost/%22,%22content-type%22:%22application/json); charset=UTF-8”,“x-ghost-version”:“3.13”,“app-pragma”:“no-cache”,“x-requested-with”:“XMLHttpRequest”,“origin”:“[https://blog.example.org.uk](https://blog.example.org.uk)”,“dnt”:“1”,“cookie”:“ **REDACTED** ”,“cf-request-id”:“redacted”,“cf-connecting-ip”:“redacted”,“cdn-loop”:“cloudflare”},“query”:{}},“res”:{“\_headers”:{“x-powered-by”:“Express”,“cache-control”:“no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0”,“access-control-allow-origin”:“[https://blog.example.org.uk](https://blog.example.org.uk)”,“vary”:“Origin, Accept-Encoding”,“content-type”:“application/json; charset=utf-8”,“content-length”:“2”,“etag”:“W/"2-vyHn7IuFo4RvsFtPoIWeCReyIC8"”},“statusCode”:200,“responseTime”:“218ms”},“msg”:“”,“time”:“2020-04-25T12:34:43.377Z”,“v”:0

Any assistance would be gratefully received.

Many thanks,

Jonathan

---

_[View the full topic](https://forum.ghost.org/t/ghost-labs-mailgun-domain-and-api/10979)._
