gitlab smtp 邮件发送配置 发表于 2019-07-03 | 分类于 Git | 暂无评论 vim /etc/gitlab/gitlab.rb 末尾追加 ```shell ##### open smtp ############ gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.xxx.cn" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "xxx@xxx.cn" gitlab_rails['smtp_password'] = "xxx" gitlab_rails['smtp_domain'] = "xxx.cn" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = false gitlab_rails['smtp_tls'] = false gitlab_rails['gitlab_email_from'] = "xxx@xxx.cn" ``` 重新配置gitlab `gitlab-ctl reconfigure` 通过命令行测试邮件是否发送成功 ```shell [root@server ~]# gitlab-rails console ------------------------------------------------------------------------------------- GitLab: 11.10.6 (3c240b7aea7) GitLab Shell: 9.0.0 PostgreSQL: 9.6.11 ------------------------------------------------------------------------------------- Loading production environment (Rails 5.0.7.2) irb(main):001:0> Notify.test_email('xxx@xxx.cn', 'Message Subject', 'Message Body').deliver_now ```