question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot get ghost to send mail from Google Cloud Platform

See original GitHub issue

Welcome to Ghost’s GitHub repo! 👋🎉

Do you need help or have a question? Please come chat in Slack: https://ghost.org/slack 👫. See https://github.com/TryGhost/Ghost/issues/6968 for why I’m not asking in slack.

Issue Summary

Tested sending email using SMTP from ssh and verified that I can relay to mailgun using postfix and got test email. Mailgun also shows the mail on the log.

However, when sending a test notification from the lab tab, sometimes the button spins and nothing happens or a toastr with [object object] shows up.

confirmed in mailgun logs that nothing was submitted.

Steps to Reproduce

  1. Installed ghost from bitnami to google cloud platform.
  2. signed up for mailgun and then followed google’s guide to setup postfix and was able to test send an email from ssh.
  3. Modified the ghost config to send using localhost so postfix will relay to mailgun, restart ghost
  4. Go to lab tab and send a test email

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

Technical details:

  • Ghost Version: 0.8.0
  • Browser/OS: Google Compute Engine/Bitnami
    production: {
        url: 'http://104.197.36.249:80',
        mail: {
            transport: 'SMTP',
            options: {
                port: 2525,
                host: 'localhost',
            }
        },
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },
        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    },

also tried

    production: {
        url: 'http://104.197.36.249:80',
        mail: {
            transport: 'SMTP',
            options: {
                service: 'Mailgun',
                port: 2525,
                auth: {
                    user: 'mailgunusername',
                    pass: 'guid',
                },
            }
        },
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },
        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    },

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
zhaoyibocommented, Jul 11, 2017

As you may know, Google Cloud Platform doesn’t allow outbound connection to ports 25, 465 and 587

So you just change port of MailGun to 2525

  "mail": {
    "transport": "SMTP",
    "options": {
        "service": "Mailgun",
        "port": 2525,
        "auth": {
            "user": "yourname",
            "pass": "yourpasswd"
        }
    }
  },

It works for me.

1reaction
samsonlarssoncommented, Oct 5, 2018

Okay, so I was dealing with this today, and nothing would work till I added the host value, as below.

"mail": {
    "transport": "SMTP",
    "options": {
        "service": "Mailgun",
        "host": "smtp.mailgun.org",
        "port": 2525,
        "auth": {
            "user": "yourname",
            "pass": "passcode"
        }
    }
},

Just for anyone else who might be experiencing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Mailgun) Ghost not sending transactional emails
Debugging a known issue when using Google Cloud Platform to configure mail with Ghost. Alternatively, we highly recommend using Mailgun. And you ...
Read more >
ghost recipients in e-mails from google
By looking at your statement, it seems like the notifications are coming from Google Cloud Platform. So the particular user account may be...
Read more >
Ghost can't send mail using Gmail (Google Apps) - DigitalOcean
Ghost can't send mail using Gmail (Google Apps) ... And I keep getting this error: “AuthError: Invalid login - 535-5.7.8 Username and ...
Read more >
Ghost issue with subscriber email and mail configuration
We have to create a mailbox in your domain dedicated for this newsletter. · Recall that I said that Ghost wants to send...
Read more >
How to Setup Ghost Blog Mail for FREE with Sendinblue and ...
In this tutorial, I want to share the main options on how to set up mail on your Ghost blog. I'll cover both...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found