0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Add mail setting with ghost.

Posted at

Ghostのmailの設定を追加した。
自前のSMTP Serverを利用したかったため、nodemailerのwellknown.jsへ
SMTP Serverをサービスとして追加した上で、config.jsへ設定を追加した。

GhostのInstallはこっち

基本的に作業はGhostのinstall directory以下で実施する。

  • Ghostのinstall directory: /srv/http/ghost

wellknown.jsにSMTPサーバを追加する

cd /srv/http/ghost
cd node_modules/nodemailer/lib/
vi wellknown.js

module.exports = { のセクションに以下の行を追加する。

wellknown.js
    "mySMTP":{
        transport: "SMTP",
        host: "YOUR SMTP Server",
        secureConnection: true,
        port: 465,
        requiresAuth: true,
        domains: ["rYOUR DOMAIN"]
    },

config.jsにmailの設定を追加する

vi config.js
config.js
        mail: {
        transport: 'SMTP',
        fromaddress: 'FROM E-MAIL ADDRESS',
        options: {
            host: 'YOUR SMTP Server', // Not required, but error occured when I hadn't add.
            service: 'mySMTP',
            auth: {
                user: 'USER NAME',
                pass: 'YOUR PASSWORD'
                }
            }
        },

ghostを再起動

pm2 restart all
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?