这个配置测试通过了:
if Rails.env.production? Rails.application.config.action_mailer.delivery_method = :smtp Rails.application.config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = { address: "smtp.exmail.qq.com", port: 465, user_name: "xxx@xxxx", password: "xxx", domain: "qq.com", authentication: :plain, ssl: true } end
这儿的文档没有讲 ssl 这个参数:http://api.rubyonrails.org/classes/ActionMailer/Base.html