我的设计邮件确认有问题。我添加了mailcatcher,它工作正常:
Thu, 24 Sep 2015 05:49:50 +0300
From: please-change-me-at-config-initializers-devise@example.com
Reply-To: please-change-me-at-config-initializers-devise@example.com
To: ...@gmail.com
Message-ID: <560364ce3f3d_34372357331e9383d@gerdon-MS-7346.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Welcome ...@gmail.com!</p>
<p>You can confirm your account email through the link below:</p>
<p><a href="http://localhost:3000/users/confirmation?confirmation_token=zYTXtSnJfom1oNS-o8Fy">Confirm my account</a></p>
但我在我的 gmail 中没有收到这个。这是我在rails上的代码:
/开发.rb
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.digest = true
config.assets.raise_runtime_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {:address => "localhost", :port => 1025}
end
/生产.rb
Rails.application.configure do
config.log_level = :debug
config.i18n.fallbacks = true
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "127.0.0.1"
:port => 25,
:domain => 'localhost:3000'
}
end
我在尝试设置邮件确认时将此评论用作文档: 如何使用设计设置电子邮件确认?