我在使用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