我刚刚开始学习ruby on rails,这是我学习的教程之一:
http://railscasts.com/episodes/206-action-mailer-in-rails-3
我跟踪它到了一个T,我还没有在我的gmail账户上收到任何东西。假设ruby的一些更新已经改变了你做事情的方式,这公平吗?
我最好的猜测是,从网上阅读一切,该教程缺少实际设置邮件程序使用smtp设置。
以下是我的smtp设置:
ActionMailer::Base.smtp_settings ={ :address => "smtp.gmail.com",
:端口=> 587,
:domain => "alexei.herokuapp.com",
:user_name => "mygmailaccount",
:password => "mygmailpassword",
:authentication =>“普通”
:enable_starttls_auto => true }
会不会是我测试时还在本地环境中?
发布于 2012-06-27 07:55:51
在Railscast中,Ryan有一行代码不会发送任何开发中的电子邮件:
Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?是你放进去的吗?如果是这样,那么当你在开发中本地运行你的应用程序时,不会发出任何电子邮件。
试着移除它。
另外,打开myapp/logs/development.log,查看当您尝试发送电子邮件时,是否会在那里显示内容。
https://stackoverflow.com/questions/11216742
复制相似问题