簡體   English   中英

無法在Catarse應用中通過動作郵件發送郵件

[英]cannot send mail through action mailer in catarse app

我正在使用catarse平台開發應用程序,我想向用戶發送電子郵件,要求他們成為項目團隊的一員。 我正在使用動作郵件程序。在我的Rails控制台中,我可以看到該消息已成功發送,但未傳遞到收件人的收件箱或跨度文件夾中。 這是我的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

好像我知道了我的user_mailer.rb中缺少默認值:“ xxxxx@xxx.xxx”

您是否可以發送已定義發送郵件功能的郵件文件快照,

其實我想看看你是否已經定義

default_from: test123@example.com

是否在郵件中,就像您曾經說過的那樣,它正在Rails服務器上顯示...所以可能是這種情況。

您可以在郵件文件或development.rb / production.rb中定義default_from

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM