How to setup basic SMTP for Ghost

Disclaimer

I’ve just started to use Ghost as a platform for blogs. Before that, I’ve been using Word Press, in one of my previous jobs. In my opinion, Ghost might become as popular as WP, while being very clear and easy for content makers an…


This content originally appeared on DEV Community and was authored by chakzefir

Disclaimer

I've just started to use Ghost as a platform for blogs. Before that, I've been using Word Press, in one of my previous jobs. In my opinion, Ghost might become as popular as WP, while being very clear and easy for content makers and developers same time.

What helped WP become so popular is the community, with many plugins, ready-to-go solutions, and how-tos, highlighting almost every moment and question that could arise around using this CMS.

I'm writing this to contribute to the public knowledge base of Ghost, simply because if I had this guide, this would save me several hours.

About

This article covers the basic SMTP setup for self-deployed Ghost instances. If you want to use Ghost from the box without customisation and you are not ready to write code and edit JSON files, then I highly recommend you to use Ghost Pro: https://account.ghost.org/signup (I have no ref program or bonuses, this is just kind advice)

If you are trying to set up Ghost and don't understand how to deal with emails, this is for you 📧

Ghost emails context

Ghost have great documentation and community. There are two cases with emails:

  • Bulk — sending newsletters, you could pay for any dedicated service and use it
  • Transactional — system stuff to work correctly with CMS

Image description from https://ghost.org/docs/faq/mailgun-newsletters/

Bulk usage is clear. You have to land your SMTP and the whole flow, or just pay for it and setup. But what if you need SMTP for Transactional emails only. Let's see what options you have:

  • Setup SMTP server manually (spend time and/or money)
  • Use one of the listed services (spend time and/or money)
  • Gmail? What's up with Gmail?

Solution

Almost everybody has Gmail, right? But a small amount of those knows, that it also includes free SMTP service, which is the same as other Google products: fast&reliable.

Everything you need is your email and dedicated app password (for security reasons).

đź—ť To generate this password:

  1. Go to https://myaccount.google.com/apppasswords
  2. Enter your regular password from your Google account (this is security settings)
  3. Select app, choose Other, and put the name (i.e SMTP)
  4. Now copy your password and write it down (you will have no chance to see it for the second time here)

For Ghost setup, I was using DO droplet, you could use a different way, but the whole flow should be similar or the same.

📧 Now, to setup SMTP for your Ghost:

  1. Go to your project directory cd /var/www/ghost
  2. Open to edit your config.production.json
  3. Copy and paste config object for mail and fill user and pass with your creds
"mail": {
    "transport": "SMTP",
    "options": {
      "service": "Google",
      "host": "smtp.gmail.com",
      "port": 587,
      "auth": {
        "user": "your@google.email",
        "pass": "this password"
      }
    }
  },

You could burn down the paper with this password.

As a result, all your transactional emails should work fine without any additional pain in the ass. For example, now you could invite somebody else as a content contributor to your website.

To conclude

If it will help at least one person, then these two hours were not a waste.

Any questions, experience, feedback? Feel free to drop a thoughtful comment.

Have a nice day 🌞

p.s Thanks Yannik Mika for suitable bg


This content originally appeared on DEV Community and was authored by chakzefir


Print Share Comment Cite Upload Translate Updates
APA

chakzefir | Sciencx (2022-03-22T21:53:45+00:00) How to setup basic SMTP for Ghost. Retrieved from https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/

MLA
" » How to setup basic SMTP for Ghost." chakzefir | Sciencx - Tuesday March 22, 2022, https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/
HARVARD
chakzefir | Sciencx Tuesday March 22, 2022 » How to setup basic SMTP for Ghost., viewed ,<https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/>
VANCOUVER
chakzefir | Sciencx - » How to setup basic SMTP for Ghost. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/
CHICAGO
" » How to setup basic SMTP for Ghost." chakzefir | Sciencx - Accessed . https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/
IEEE
" » How to setup basic SMTP for Ghost." chakzefir | Sciencx [Online]. Available: https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/. [Accessed: ]
rf:citation
» How to setup basic SMTP for Ghost | chakzefir | Sciencx | https://www.scien.cx/2022/03/22/how-to-setup-basic-smtp-for-ghost/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.