1

请帮忙!我似乎无法让 sendgrid 插件工作,我已经设计好了。有没有办法将设备用作电子邮件的发件人,如果是,那么如何?或者我做错了什么:这是我重要的 config/initializers/devise.rb 代码:

 Devise.setup do |config|
   # ==> Mailer Configuration

   #config.mailer_sender = "myapp.herokuapp.com"

   # Configure the class responsible to send e-mails.
   #config.mailer = "Devise::Mailer"

如果我想使用 sendgrid,我必须取消注释吗?

在 environment/production.rb 我有:

 config.action_mailer.default_url_options = { :host => 'myapp.herokuapp.com' }
4

1 回答 1

2

你完成了基本的 Sendgrid 配置了吗?

https://devcenter.heroku.com/articles/sendgrid

ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => 'heroku.com',
  :enable_starttls_auto => true
}
于 2013-10-20T02:46:27.730 回答