ssc*_*rus 6 smtp ruby-on-rails actionmailer heroku ruby-on-rails-3
以下是setup_mail.rb中Google Apps的smtp设置.
:address => "smtp.gmail.com",
:port => 587,
:domain => 'mysite.co',
:user_name => 'noreply@mysite.co',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true
Run Code Online (Sandbox Code Playgroud)
我的开发日志详细显示了生成的电子邮件并发送到正确的电子邮件地址......但它们没有到达.我只能认为上面的设置一定有问题.你能看出问题所在吗?
一旦解决了这个问题,我有什么问题可以让它在Heroku上运行吗?
注意:以上是记录弃用警告:
DEPRECATION WARNING: Giving a hash to body is deprecated, please use instance va
riables instead. (called from process at C:/Sanj/Ruby192/lib/ruby/gems/1.9.1/gem
s/actionmailer-3.0.0/lib/action_mailer/old_api.rb:77)
Run Code Online (Sandbox Code Playgroud)
在您的用户控制器中不要忘记添加.deliver
UserMailer.registration_confirmation(@user).deliver
Run Code Online (Sandbox Code Playgroud)
这让我很难过
结果发现问题出在其他地方 - 一个旧的 AuthLogic 教程让我在发送激活码方面找到了正确的方向,但在发送电子邮件本身方面却找到了错误的方向。Rails 正在生成电子邮件,但没有发送它,因为 mail_helper 的代码没有进行最后一步。
如果您回顾这篇文章,我学到了什么:确保您的 Rails 3.0 user_mailer 有(或类似):
mail(:to => "#{user.login} <#{user.email}>", :subject => "Registered" )
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9853 次 |
最近记录: |