我已将Rails Web应用程序部署到heroku。现在,我想向注册了我的Web应用程序的用户发送电子邮件。我想从公司电子邮件中发送电子邮件。假设我的公司电子邮件为abc@business-email.in
。
通过heroku logs
检查时出现错误。
86ms:SocketError(getaddrinfo:名称或服务未知):
这是我在config/production.rb
中的邮件设置
#Heroku mail configuration
config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.smtp_settings = {
:address => "smtp.business-email.in",
:domain => 'myApp.herokuapp.com',
:port => 25,
:user_name => "abc@business-email.in",
:password => ENV['SMTP_PASSWORD'],
:authentication => :plain,
:enable_starttls_auto => true
}