Rails ActionMailer在开发模式下具有Devise + Google Apps

我正在尝试将ActionMailer配置为使用我的Google Apps帐户以开发模式从Devise发送邮件。 我已将以下内容添加到我的config / environments / development.rb文件中,但看起来邮件没有被发送。 注意:这适用于Google Apps,而非Gmail(但Gmail服务器应该可以使用 – 它们可以在我的邮件客户端中使用)。

我的配置中有什么东西跳出来的?

config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => "mydomain.com", :authentication => :login, :user_name => "myemaiL@mydomain.com", :password => "mypass" } 

我们使用Google Apps帐户(和Devise)成功使用了所有相同的设置 – 唯一的区别是我们使用“plain”进行身份validation。

稍有不同 – 我们在生产中使用它并在我们的暂存环境中使用它(我们发送电子邮件,但所有都是测试电子邮件地址而不是用户)。 在开发时,我们只需查看rails日志来调试电子邮件……

但有一件事你可能会检查:我在使用MacPorts设置的macbook上测试GMail,但使用rym和homebrew设置了ruby / rails和其他东西,并且在这个环境中获得SSLexception – 当我设置时:enable_starttls_auto => false错误已停止,但未发送邮件。 我认为MacPorts安装的库和Rails使用的库之间存在冲突。

不确定是否有帮助:-)