configuring Gmail for Ghost on Ubuntu Server

The official Ghost documentation has a pretty good write-up about how to congifure your mailserver for various clients. This post offers a bit more insight into configuring Gmail.

The Ghost documents describe the process for configuring Gmail [in config.js] as follows:

mail: {
    transport: 'SMTP',
    options: {
        service: 'Gmail',
        auth: {
            user: 'youremail@gmail.com',
            pass: 'yourpassword'
        }
    }
}

I found that this configuration worked for my accounts that end with @gmail.com. [For instance I have an old account for this server: kategorisera@gmail.com, for which the above config settings worked just fine.] I experienced problems, however, when I tried to enter in a google-managed domain (i.e. one where I use Gmail, but have @mydomainname.com instead of @gmail.com).

To make Google mananaged, custom domain email work in Ghost, you'll need a slightly different config.js entry:

mail: {
            service: "Gmail",
            fromaddress: 'youremail@yourdomain.com',
            transport: 'SMTP',
            options: {
                host: "smtp.gmail.com", 
                secureConnection: true,
                port: 465,
                auth: {
                    user: 'youremail@yourdomain.com',
                    pass: 'password'
                 }
            }
        }

Credits

Thanks to kurapika1811 for explaining this!


View or Post Comments