1.开启qq邮箱的POP3/SMTP服务并保存好授权码
2.修改gitlab的配置文件:/etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.qq.com" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "******@qq.com" gitlab_rails['smtp_password'] = "授权码" gitlab_rails['smtp_domain'] = "smtp.qq.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = true gitlab_rails['gitlab_email_from'] = '******@qq.com'
重启生效:gitlab-ctl reconfigure
3.测试配置是否成功:
执行 gitlab-rails console进入控制台。 然后在控制台提示符后输入下面的命令 发送一封测试邮件:Notify.test_email(‘收件人邮箱’, ‘邮件标题’, ‘邮件正文’).deliver_now
测试成功,添加gitlab用户又可以收到邮件了!
大功告成!!