【发布时间】:2013-12-17 12:04:38
【问题描述】:
我已经按照following tutorial 创建了一个联系表单。
一切都很好,但正如教程所说 For real e-mail delivery, you should set up SMTP in the environment settings. 我如何设置 SMTP?
按照this 链接中的建议,我创建并编辑了 smtp_settings.rb;但一点运气都没有。它仍然不会将电子邮件发送给真实用户。
smtp_settings.rb
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
user_name: "myaccount@gmail.com",
password: "abcpassword",
domain: "mail.google.com",
authentication: :login,
enable_starttls_auto: true
}
end
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4