# Subscribe button does not work

**URL:** <https://forum.ghost.org/t/subscribe-button-does-not-work/15556>\
**Category:** Memberships & subscriptions\
**Created:** [July 2, 2020, 7:58am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556 "2020-07-02T07:58:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 2, 2020, 7:58am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/1 "2020-07-02T07:58:31Z")

</div>

Hi there,

I use local hosted Ghost. My mailgun server is already up and running and when I test to myself, the email was sent.

However, when I try to input email address in my homepage and click subscribe, the subscribe button keeps rotating endlessly.

Can anyone help?

You can try my blog here. [https://christje.com/signup/](https://christje.com/signup/)

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 2, 2020, 7:22pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/2 "2020-07-02T19:22:07Z")

</div>

Hi @Christ_Je,

have you set up your mail in `config.production.json` properly?  
The Mailgun settings in ghost admin - labs - mailgun are only used for sending newsletters and not transactional mails like signins/signups/subscribtions.

---

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 3, 2020, 1:35am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/3 "2020-07-03T01:35:11Z")

</div>

Hi @daniel1,

Yes, I already setup my `config.production.json` according to this

[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/concepts/config/?&_ga=2.79359828.1509125417.1593660606-1417309003.1593660606#mail)]

What do you mean by not transactional email?

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 3, 2020, 7:40pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/4 "2020-07-03T19:40:11Z")

</div>

Hi,

could you double check, that the config.production.json mail config is correct?

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

```

If that is definitely correct, could you check your ghost error.log at `/ghost/content/logs/*.error.log`?

EDIT: Transactional mails and marketing mails are differentiated in some factors.  
Email delivery sounds easy, but there can be some caveats.  
Transactional mails include things like: signin,signup,subscribe, receipts etc. so in general mails that should be delivered immediately to one distinct user, while marketing emails like newsletters are sent to multiple users at the same time, they don’t necessarly have to have a high deliverability.

What i meant:

- Ghost Admin - Labs - Mailgun settings  
_is used to send newsletter email via mailgun_

- Mail configuration in `config.production.json`  
_is used to send signin/signup/subscribe email_

---

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 4, 2020, 12:53am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/5 "2020-07-04T00:53:18Z")

</div>

Yes, I have.

 ![Screen Shot 2020-07-04 at 07.34.35](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/d/d3af727582f20459365b529b972ca386453e5221.png)

The ghost error log looks like this.

`{"name":"Log","hostname":"daenerys.id.rapidplex.com","pid":178993,"level":50,"err":{"id":"01e5bb20-bd8e-11ea-a212-c7988471bdcd","domain":"https://christje.com/","code":null,"name":"EmailError","statusCode":500,"level":"normal","message":"Failed to send email. Reason: connect ECONNREFUSED 104.47.33.33:25.","help":"\"Please see https://ghost.org/docs/concepts/config/#mail for instructions on configuring email.\"","stack":"EmailError: Failed to send email. Reason: connect ECONNREFUSED 104.47.33.33:25.\n at EmailError.GhostError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/@tryghost/errors/lib/errors.js:10:26)\n at new EmailError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/@tryghost/errors/lib/errors.js:34:20)\n at createMailError (/home/christje/cms-ghost/apps/versions/3.18.1/core/server/services/mail/GhostMailer.js:51:12)\n at EventEmitter.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/core/server/services/mail/GhostMailer.js:117:28)\n at Object.onceWrapper (events.js:286:20)\n at EventEmitter.emit (events.js:198:13)\n at EventEmitter.emit (domain.js:448:20)\n at DirectMailer.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/directmail/lib/mailer.js:185:42)\n at SMTPClient.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/directmail/lib/mailer.js:277:9)\n at Object.onceWrapper (events.js:286:20)\n at SMTPClient.emit (events.js:198:13)\n at SMTPClient.EventEmitter.emit (domain.js:448:20)\n at SMTPClient._onError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/simplesmtp/lib/client.js:373:10)\n at Socket.emit (events.js:198:13)\n at Socket.EventEmitter.emit (domain.js:448:20)\n at emitErrorNT (internal/streams/destroy.js:91:8)\n at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n at process._tickCallback (internal/process/next_tick.js:63:19)"},"msg":"Failed to send email. Reason: connect ECONNREFUSED 104.47.33.33:25.","time":"2020-07-04T00:33:40.308Z","v":0}`

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 4, 2020, 7:34am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/6 "2020-07-04T07:34:41Z")

</div>

Hi,  
please see my prior posted example and add:

- secure connection attribute

- host attribute  
in your mail config.

You can find the right host domain in Mailgun Dashboard - Sending - Domain Settings - SMTP credentials

---

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 4, 2020, 8:23am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/7 "2020-07-04T08:23:13Z")

</div>

I did actually do that.

 ![Screen Shot 2020-07-04 at 15.19.03](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/3/3fc569001dff9eaede219727e2633359d90033e2.png)

But still, there is still error when I want to subscribe…

That’s why I was so confused on how. Online the subscribe button does not work. The rest already been checked by mailgun.

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 4, 2020, 10:09pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/8 "2020-07-04T22:09:53Z")

</div>

Could you please change port to 465 in your mail config (restart ghost after that)  
and see if that changes the error. Also please update your ghost version.

---

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 5, 2020, 11:20am UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/9 "2020-07-05T11:20:16Z")

</div>

Hi @daniel1, thank you for the constant support. But, I have tried changing to the 3 port but still cannot have the subscription.

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 5, 2020, 3:49pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/10 "2020-07-05T15:49:05Z")

</div>

Okay, let’s try something else, so we can rule out misconfiguration in ghost itself.  
Let’s try to send mails directly from your server (without mailgun):  
Please edit mail in `config.production.json` like so:

```auto
"mail": {
    "transport": "Direct"
  },

```

If the signup/signin form works, see if mail gets delivered  
_(it will most likely be in your spam folder!)_

Keep me updated!

---

<div class="post-metadata">

**Author:** ![Christ\_Je](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/christ_je/32/8708_2.png) [@Christ\_Je](https://forum.ghost.org/u/Christ_Je)\
**Post date:** [July 5, 2020, 4:25pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/11 "2020-07-05T16:25:34Z")

</div>

Still cannot subscribe 🙂 I don’t know what happen but I think there might be error in the root folder?

The error log is like this:

`{"name":"Log","hostname":"daenerys.id.rapidplex.com","pid":178993,"level":50,"err":{"id":"90fd0e00-bedb-11ea-a212-c7988471bdcd","domain":"https://christje.com/","code":null,"name":"EmailError","statusCode":500,"level":"normal","message":"Failed to send email. Reason: connect ECONNREFUSED 104.47.55.161:25.","help":"\"Please see https://ghost.org/docs/concepts/config/#mail for instructions on configuring email.\"","stack":"EmailError: Failed to send email. Reason: connect ECONNREFUSED 104.47.55.161:25.\n at EmailError.GhostError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/@tryghost/errors/lib/errors.js:10:26)\n at new EmailError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/@tryghost/errors/lib/errors.js:34:20)\n at createMailError (/home/christje/cms-ghost/apps/versions/3.18.1/core/server/services/mail/GhostMailer.js:51:12)\n at EventEmitter.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/core/server/services/mail/GhostMailer.js:117:28)\n at Object.onceWrapper (events.js:286:20)\n at EventEmitter.emit (events.js:198:13)\n at EventEmitter.emit (domain.js:448:20)\n at DirectMailer.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/directmail/lib/mailer.js:185:42)\n at SMTPClient.<anonymous> (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/directmail/lib/mailer.js:277:9)\n at Object.onceWrapper (events.js:286:20)\n at SMTPClient.emit (events.js:198:13)\n at SMTPClient.EventEmitter.emit (domain.js:448:20)\n at SMTPClient._onError (/home/christje/cms-ghost/apps/versions/3.18.1/node_modules/simplesmtp/lib/client.js:373:10)\n at Socket.emit (events.js:198:13)\n at Socket.EventEmitter.emit (domain.js:448:20)\n at emitErrorNT (internal/streams/destroy.js:91:8)\n at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n at process._tickCallback (internal/process/next_tick.js:63:19)"},"msg":"Failed to send email. Reason: connect ECONNREFUSED 104.47.55.161:25.","time":"2020-07-05T16:21:22.786Z","v":0}`

---

<div class="post-metadata">

**Author:** ![daniel1](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@daniel1](https://forum.ghost.org/u/daniel1)\
**Post date:** [July 5, 2020, 5:02pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/12 "2020-07-05T17:02:17Z")

</div>

I see,

could you please update your ghost cli and ghost version, by running following commands in ghost terminal:

- **sudo npm i -g ghost-cli@latest**
- **ghost update**

You still run 3.18.1, the newest version is 3.22.1

---

<div class="post-metadata">

**Author:** ![ravinayag](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@ravinayag](https://forum.ghost.org/u/ravinayag)\
**Post date:** [September 1, 2020, 1:21pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/13 "2020-09-01T13:21:44Z")

</div>

Hi,  
I changed to “Direct”, and i tested to do subscribe, It takes long time with rolling circle on continue and later getting same error _“Please enter a valid email address!”_

**After Looking at logs : Got strange errors for your Ref.**

[2020-09-01 18:31:23] INFO “POST /members/api/send-magic-link/” 200 60039ms  
[2020-09-01 18:31:23] INFO “POST /members/api/send-magic-link/” 200 60041ms  
[2020-09-01 18:32:33] ERROR  
NAME: EmailError  
_ **MESSAGE: Failed to send email. Reason: connect ETIMEDOUT 74.125.24.26:465.** _

level: normal

“Please see [Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/concepts/config/#mail) for instructions on configuring email.”  
EmailError: Failed to send email. Reason: connect ETIMEDOUT 74.125.24.26:465.  
at EmailError.GhostError (/var/www/blog1/versions/3.31.2/node\_modules/@tryghost/errors/lib/errors.js:10:26)  
at new EmailError (/var/www/blog1/versions/3.31.2/node\_modules/@tryghost/errors/lib/errors.js:34:20)  
at createMailError (/var/www/blog1/versions/3.31.2/core/server/services/mail/GhostMailer.js:52:12)  
at EventEmitter. (/var/www/blog1/versions/3.31.2/core/server/services/mail/GhostMailer.js:119:28)  
at Object.onceWrapper (events.js:286:20)  
at EventEmitter.emit (events.js:198:13)  
at EventEmitter.emit (domain.js:448:20)  
at DirectMailer. (/var/www/blog1/versions/3.31.2/node\_modules/directmail/lib/mailer.js:185:42)  
at SMTPClient. (/var/www/blog1/versions/3.31.2/node\_modules/directmail/lib/mailer.js:277:9)  
at Object.onceWrapper (events.js:286:20)  
at SMTPClient.emit (events.js:198:13)  
at SMTPClient.EventEmitter.emit (domain.js:448:20)  
at SMTPClient.\_onError (/var/www/blog1/versions/3.31.2/node\_modules/simplesmtp/lib/client.js:373:10)  
at TLSSocket.emit (events.js:198:13)  
at TLSSocket.EventEmitter.emit (domain.js:448:20)  
at emitErrorNT (internal/streams/destroy.js:91:8)

[2020-09-01 18:33:36] INFO “GET /content/images/2020/06/blog.gif.gif” 200 20ms  
[2020-09-01 18:34:44] ERROR

NAME: EmailError  
MESSAGE: Failed to send email. Reason: connect ETIMEDOUT 74.125.24.26:465.

level: normal

“Please see [Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/concepts/config/#mail) for instructions on configuring email.”  
EmailError: Failed to send email. Reason: connect ETIMEDOUT 74.125.24.26:465.  
at EmailError.GhostError (/var/www/blog1/versions/3.31.2/node\_modules/@tryghost/errors/lib/errors.js:10:26)  
at new EmailError (/var/www/blog1/versions/3.31.2/node\_modules/@tryghost/errors/lib/errors.js:34:20)  
at createMailError (/var/www/blog1/versions/3.31.2/core/server/services/mail/GhostMailer.js:52:12)  
at EventEmitter. (/var/www/blog1/versions/3.31.2/core/server/services/mail/GhostMailer.js:119:28)  
at Object.onceWrapper (events.js:286:20)  
at EventEmitter.emit (events.js:198:13)  
at EventEmitter.emit (domain.js:448:20)  
at DirectMailer. (/var/www/blog1/versions/3.31.2/node\_modules/directmail/lib/mailer.js:185:42)  
at SMTPClient. (/var/www/blog1/versions/3.31.2/node\_modules/directmail/lib/mailer.js:277:9)  
at Object.onceWrapper (events.js:286:20)  
at SMTPClient.emit (events.js:198:13)  
at SMTPClient.EventEmitter.emit (domain.js:448:20)  
at SMTPClient.\_onError (/var/www/blog1/versions/3.31.2/node\_modules/simplesmtp/lib/client.js:373:10)  
at TLSSocket.emit (events.js:198:13)  
at TLSSocket.EventEmitter.emit (domain.js:448:20)  
at emitErrorNT (internal/streams/destroy.js:91:8)

+++++++++++++++++++++++++++++++++++++++++++++  
**Q : Strange IP: 74.125.24.26, why its connecting to google ?** where as my email host ip is different. Note : This is only happening if change to “Direct” in transport properties.

Here is my config.production.json file

“mail”: {  
“from”: “Blog Mailer [dmart@mydomain.com](mailto:dmart@mydomain.com)”,  
“transport”: “Direct”,  
“options”: {  
“service”: “email”,  
“host”: “[mail.mydomain.com](http://mail.mydomain.com)”,  
“port”: 465,  
“secureConnection”: true,  
“ignoreTLS”: true,  
“auth”: {  
“user”: “[dmart@mydomain.com](mailto:dmart@mydomain.com)”,  
“pass”: “xxxxx”  
}

---

<div class="post-metadata">

**Author:** ![calamitywithinsanity](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@calamitywithinsanity](https://forum.ghost.org/u/calamitywithinsanity)\
**Post date:** [March 19, 2022, 6:50pm UTC](https://forum.ghost.org/t/subscribe-button-does-not-work/15556/14 "2022-03-19T18:50:48Z")

</div>

I had the same error recently and I eventually realized that it was “upstream” of Ghost. I use Linode as my cloud provider – by default, Linode blocks ports 25, 465, and 587. I had to follow [their tutorial](https://www.linode.com/docs/guides/running-a-mail-server/) and open a Support Ticket to get access to those ports (Special thanks to the Linode team! They were very helpful and supportive.)

I have never used a cloud provider other than Linode, but this might be the case for other platforms as well? As soon as I was granted access to those ports, the subscribe button started working.

I have attached a screenshot of the message Linode shows when you create a Linode:  
 ![linode_mail_message](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/0/7/077c387fc98d04addfc229a8f7c65f859a5e674a.png)

I hope this helps someone! :)

I also posted about this on r/ghost: [https://www.reddit.com/r/Ghost/comments/tdla4b/subscribe\_button\_not\_working\_on\_selfhosted\_ghost/](https://www.reddit.com/r/Ghost/comments/tdla4b/subscribe_button_not_working_on_selfhosted_ghost/)

K/R,  
calamitywithinsanity
