[root@test32 ~]# vi /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'] = "[email protected]"
gitlab_rails['smtp_password'] = "****"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]
[root@test32 gitlab]# gitlab-ctl reconfigure
测试
[root@test32 gitlab]# gitlab-rails console
-------------------------------------------------------------------------------------
GitLab: 11.7.5 (c5b5b18)
GitLab Shell: 8.4.4
postgresql: 9.6.11
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.0.7.1)
irb(main):003:0> Notify.test_email('自己的能收邮件的邮箱@qq.com', 'Message Subject', 'Message Body').deliver_now
然后输出一大串日志,成功的话能看出来,而且能收到邮件, 然后去网页试试忘记密码输入邮箱会收到一个重置密码的邮件