gitlab设置smtp服务器

$ sudo vi /etc/gitlab/gitlab.rb

# Change the external_url to the address your users will type in their browser

#Sending application email via SMTP

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'] = "xxpassword"

gitlab_rails['smtp_domain'] = "163.com"

gitlab_rails['smtp_authentication'] = :login

gitlab_rails['smtp_enable_starttls_auto'] = true

##修改gitlab配置的发信人

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

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


测试

root@02471662b839:/etc/gitlab# gitlab-rails console
Loading production environment (Rails 4.2.10)
irb(main):001:0> Notify.test_email('[email protected]','ttt','aeidafd').deliver_now


Notify#test_email: processed outbound mail in 173.4ms


Sent mail to [email protected] (309.0ms)
Date: Thu, 03 May 2018 04:30:24 +0000
From: git-noreply
Reply-To: git-noreply
To: [email protected]
Message-ID: <[email protected]>
Subject: ttt
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All



aeidafd




=> #, >, >, , >, , , , , , >

你可能感兴趣的:(项目)