vim /etc/gitlab/gitlab.rb
# smtp 配置
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxxx@qq.com"
gitlab_rails['smtp_password'] = "password"
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'] = "admin@example.com"
gitlab_rails['gitlab_email_from'] = 'xxxx@qq.com'
gitlab-ctl reconfigure 重启服务