[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'] = "XXXX@qq.com"
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'] = 'XXXX@qq.comgit
[root@test32 gitlab]# gitlab-ctl reconfigure sql
測試
[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
而後輸出一大串日誌,成功的話能看出來,並且能收到郵件, 而後去網頁試試忘記密碼輸入郵箱會收到一個重置密碼的郵件ide