vim /etc/gitlab/gitlab.rb
以腾讯企业邮箱为例其它邮箱大同小异
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "邮箱地址"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_domain'] = "exmail.qq.com"
gitlab_rails['gitlab_email_from'] = '邮箱地址'
gitlab-ctl reconfigure
gitlab-ctl restart
测试邮件服务是否正常
gitlab-rails console
等到出现 “>”再执行下面命令
Notify.test_email("XXX@XXX.XX","title","gitlab").deliver_now
本文由 systemofdown 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。