阿里云Centos7中GitLab使用smtp 163邮箱发送邮件的注意事宜

1.修改gitlab.rb配置项

目录:/etc/gitlab/gitlab.rb

修改:

gitlab_rails['smtp_enable'] = true

gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "xxx"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true

gitlab_rails['smtp_tls'] = true

gitlab_rails['gitlab_email_from'] = '[email protected]'

user['git_user_email'] = "[email protected]"

2.重启gilab配置

修改后执行gitlab-ctl reconfigure

3.进入rails控制台测试邮件发送

gitlab-rails console
irb(main):003:0> Notify.test_email('[email protected]', 'Message Subject', 'Message Body').deliver_now

# 示例Notify.test_email('收件人邮箱', '邮件标题', '邮件正文').deliver_now

gitlab官方配置smtp

https://doc.gitlab.cc/omnibus/settings/smtp.html#aliyun-direct-mail

你可能感兴趣的:(阿里云Centos7中GitLab使用smtp 163邮箱发送邮件的注意事宜)