我在使用ruby在rails上發送電子郵件時遇到問題。當我使用gmail smtp時,它運行良好,但是當我嘗試使用我在cpanel中創建的電子郵件時,我現在似乎無法發送任何電子郵件。有誰知道如何配置這個?謝謝。發送電子郵件紅寶石在rails dev環境smtp cpanel
這裏是我的mailer_setup.rb下初始化文件夾
ActionMailer::Base.delivery_method = :smtp # be sure to choose SMTP delivery
ActionMailer::Base.smtp_settings = {
:address => "mail.humouno.com",
:port => 25,
:domain => "humouno.com",
:user_name => "[email protected]",
:password => "********",
:authentication => "login",
:enable_starttls_auto => true
}
這裏下的environment.rb
Humouno::Application.configure do
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.action_mailer.perform_deliveries = true
config.assets.debug = true
end
我試圖發送電子郵件在我的本地主機的development.rb。
你能更改'config.action_mailer.raise_delivery_errors'爲true,重新啓動併發布錯誤? – steakchaser