本文 Ghost version: 4.32.1

Ghost 是一个年轻的博客系统,迭代速度之快使得互联网上许多相关的教程已经过时,特别是邮件配置方面。 经过多次尝试,终于得出了邮件系统的正确配置方法,在此记录。以网易域名邮箱为例:

修改配置文件

编辑config.production.json,将mail修改为:

  "mail": {
    "transport": "SMTP",
    "from": "'Your Blog' <blog@yoursite.com>",
    "options": {
      "host": "smtp.ym.163.com",
      "port": 994,
      "secureConnection": true,
      "auth": {
        "user": "blog@yoursite.com",
        "pass": "yourpassword"
      }
    }
  },

使用 Mailgun

"mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "host": "smtp.mailgun.org",
    "port": 587,
    "secure": true,
    "auth": {
      "user": "postmaster@example.mailgun.org",
      "pass": "1234567890"
    }
  }
},

参考资料

https://ghost.org/docs/config/#mail