【发布时间】:2013-04-16 00:45:30
【问题描述】:
我正在使用 Mandrill 为网站上的用户构建反馈表(他们填写表单并向我发送电子邮件)。
我想在开发中测试电子邮件功能。我使用独角兽作为服务器,我的本地地址是 0.0.0:8080
但是我收到 500 服务器错误,Net::SMTPServerBusy : Relay Access Denied
我一步一步按照 Heroku 的说明进行操作。
这里是m application.rb的配置:
config.action_mailer.smtp_settings = {
:address => 'smtp.mandrillapp.com',
:port => '587',
:domain => 'heroku.com',
:user_name => ENV['MANDRILL_USERNAME'],
:password => ENV['MANDRILL_APIKEY']
}
ActionMailer::Base.delivery_method = :smtp
我按照 mandrill/heroku 网页上的说明进行设置。
我有一个 .env 文件,其中包含一个 MANDRILL_USERNAME 和我的 MANDRILL_APIKEY
这是我的 ActionMailer 文件:
class FeedbackMailer < ActionMailer::Base
default :from => ""
default :to => "xxx@stanford.edu"
default :subject => "feedback about xxx"
def send_feedback(message)
#debugger
@message = message
mail(:from => message[:sender_email])
end
end
任何帮助将不胜感激。
我可以确认电子邮件已在生产中发送。
【问题讨论】:
-
您是否尝试过在 application.rb 中使用 config.action_mailer.delivery_method = :smtp 而不是 ActionMailer::Base.delivery_method = :smtp?
标签: ruby-on-rails-3 email heroku mandrill