gitlab邮件服务设置

修改gitlab配置-邮件服务(163邮箱为例)

vim /etc/gitlab/gitlab.rb

```
#开启smtp
gitlab_rails['smtp_enable'] = true
#126smtp地址
gitlab_rails['smtp_address'] = "smtp.163.com"
#smtp地址
gitlab_rails['smtp_port'] = 465
#smtp用户名
gitlab_rails['smtp_user_name'] = "test115@163.com"
#smtp密码
gitlab_rails['smtp_password'] = "MRV***LQC"
#126域名
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['smtp_user_name'] 值一样
gitlab_rails['gitlab_email_from'] = 'test115@163.com'
#发送邮件展示的名称
gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
```

重新配置

>gitlab-ctl reconfigure

控制台测试

```
#打开gitlab控制台,时间有点长,需要耐心等待
gitlab-rails console
#发送邮件测试
#Notify.test_email('接收人邮箱地址','邮件主题','邮件内容').deliver_now
Notify.test_email('example@163.com','gitlab邮件配置','测试邮件内容').deliver_now
```

参考`https://blog.csdn.net/cen50958/article/details/103136843`

    A+
发布日期:2021年06月07日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: