1.开启QQ邮箱的smtp服务
2.修改gitlab配置
vim /etc/gitlab/gitlab.rb
按/后输入smtp_enable,找到下面这一串文本,进行修改
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "360848872@qq.com"
gitlab_rails['smtp_password'] = "xxxxxxx"
gitlab_rails['smtp_domain'] = "qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
user['git_user_email'] = "360848872@qq.com"
gitlab_rails['gitlab_email_from'] = '360848872@qq.com'
按esc退出到命令行模式
之后:wq 保存并退出
gitlab-ctl reconfigure
3.测试邮件服务是否正常
gitlab-rails console
Notify.test_email('接收方邮件地址','邮件标题','邮件内容').deliver_now
按回车,测试发送。