我正在使用 Zoho mail 從我的 Rails 應用程式發送電子郵件。但是EOFError - end of file reached在嘗試發送電子郵件時出現錯誤。下面是我的配置development.rb
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.zoho.com",
:port => 465,
:user_name => '[email protected]',
:password => 'zoho_mail_password',
:authentication => :login,
:ssl => true,
:tls => true,
:enable_starttls_auto => true
}
這是我的日志檔案中的錯誤
Completed 500 Internal Server Error in 7481ms (ActiveRecord: 2.1ms | Allocations: 44097)
EOFError - end of file reached:
app/controllers/users_controller.rb:19:in `create'
請幫忙。
uj5u.com熱心網友回復:
我設法解決了這個問題。我必須在application_mailer.rb檔案中設定默認地址
default from: 'Business Name <[email protected]>'
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/410570.html
標籤:
上一篇:洗掉text_area下面的空格
