我构建了一个小型联系表单来使用 Rails 传递消息。我密切关注 ActionMailer 上的 Rails-Guides ( http://guides.rubyonrails.org/action_mailer_basics.html ) - 特别是 Point 5.2 Action Mailer Configuration for GMail
,因为我想为此目的使用 Gmail。
我在开发环境中。
问题:特定电子邮件地址没有消息。
检查时development.log
我发现:
Sent mail to // the specific email-address appears
Date: Thu, 28 Feb 2013 13:26:37 +0100
From: // my gmail account
To: rt@netlogix.de
Message-ID: <512f4cfdc419c_1b2020e4ab495633@PC-MYNAME.mail>
Subject: The Subject
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
我错过了什么,还是因为我正在开发中?先感谢您!
编辑:
继承人中的配置development.rb
:
# Configuring GMAIL
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'localhost:3000'}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "localhost:3000",
:user_name => "myemailaddress@gmail.com",
:password => "myPW",
:authentication => "plain",
:enable_starttls_auto => true
}
编辑2:
我想可能是我们的防火墙出了问题,所以我将项目推送到 heroku:Delivering 仍然失败,但这里是日志:
Processing by MessagesController#create as HTML
Sent mail to (email-adress) (690ms)
Completed 500 Internal Server Error in 712ms
Net::SMTPAuthenticationError (535-5.7.1 Please log in with your web browser and then try again.)