无法通过catarse app中的动作邮件发送邮件

时间:2014-01-21 06:21:22

标签: ruby-on-rails actionmailer

我正在使用catarse平台开发一个应用程序,我想向用户发送一封电子邮件,要求他们成为项目团队的一员。 我正在使用动作邮件程序。在我的rails控制台中,我可以看到该邮件已成功发送,但它未被发送到收件人的收件箱或span文件夹。 这是我的development.rb

Catarse::Application.configure do
  Slim::Engine.set_default_options pretty: true
  # Settings specified here will take precedence over those in config/application.rb.

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  config.action_mailer.default_url_options = { :host => 'localhost:3000' }

  # Do not eager load code on boot.
  config.eager_load = false

  # Show full error reports and disable caching.
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send.
  config.action_mailer.raise_delivery_errors = false

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  # Raise an error on page load if there are pending migrations
  config.active_record.migration_error = :page_load

  # Debug mode disables concatenation and preprocessing of assets.
  # This option may cause significant delays in view rendering with a large
  # number of complex assets.
  config.assets.debug = true

  # mailcatcher configs

  config.action_mailer.smtp_settings = {
    :enable_starttls_auto => true,
    :address => "smtp.gmail.com",
    :port => 587,
    :domain => "gmail.com",
    :authentication => :login,
    :user_name => *******,
    :password => *******,
  }

end

2 个答案:

答案 0 :(得分:0)

看起来我发现我失踪了 默认来自:“xxxxx@xxx.xxx” 在我的user_mailer.rb

答案 1 :(得分:0)

你可以发送你已经定义了发送邮件功能的邮件文件的快照,

实际上我想看看你是否定义了

default_from: test123@example.com

邮件中的邮件是否正确,因为你曾说过它在rails服务器上显示... 所以情况可能就是这样。

您可以在邮件程序文件或development.rb / production.rb

中定义default_from

ActionMailer::Base.default :from => 'test123@example.com'