typora/note/devops/gitlab/发送邮件配置.md

26 lines
765 B
Markdown
Raw Normal View History

2024-12-11 21:48:55 -05:00
### gitlab.rb添加以下配置
``` yaml
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "15735657423@163.com"
gitlab_rails['smtp_password'] = "HJYXCQIGREDDVHQI" #163授权的密码,非登陆密码
gitlab_rails['smtp_domain'] = "smtp.163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['gitlab_email_from'] = "15735657423@163.com"
gitlab_rails['gitlab_email_reply_to'] = "noreply@gitlab.heysq.com"
gitlab_rails['smtp_tls'] = true
# <!-- gitlab_rails['smtp_enable_starttls_auto'] = true -->
```
### 测试邮件
``` shell
gitlab-rails c -e production
Notify.test_email('1904705132@qq.com', 'Message Subject', 'Message Body').deliver_now
```