嗨,我开始调整我的设计宝石,我看到了一个问题
当我点击链接时 - > “忘了你的密码?”
比我点击我的电子邮件并点击“发送”
理想情况下,我应该接收带有链接的邮件..但我没有收到此邮件
在控制台日志中我看到了:
Started POST "/users/password" for 127.0.0.1 at 2012-08-27 10:42:30 +0300
Processing by Devise::PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"E7957iR69EDbZArYyaA8tGRmtuwr6LOM+lf7geAitZU=", "user"=>{"email"=>"...@gmail.com"}, "commit"=>"Send me reset password instructions"}
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = '...@gmail.com' LIMIT 1
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."reset_password_token" = 'K8XfKY4RV2ZJKHzXShj7' LIMIT 1
(0.1ms) begin transaction
(1.0ms) UPDATE "users" SET "reset_password_token" = 'K8XfKY4RV2ZJKHzXShj7', "reset_password_sent_at" = '2012-08-27 07:42:30.170634', "updated_at" = '2012-08-27 07:42:30.171855' WHERE "users"."id" = 1
(174.2ms) commit transaction
Rendered devise/mailer/reset_password_instructions.html.erb (1.6ms)
Sent mail to ...@gmail.com (1062ms)
Date: Mon, 27 Aug 2012 10:42:31 +0300
from: from localhost:3000 <local@gmail.com>
reply-to: from localhost:3000 <local@gmail.com>
To: ...@gmail.com
Message-ID: <503b24e732409_2f9224e7fbbe307c2@demitriydn.mail>
Subject: Reset password instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Hello ...@gmail.com!</p>
<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
<p><a href="http://localhost:3000/users/password/edit?reset_password_token=K8XfKY4RV2ZJKHzXShj7">Change my password</a></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
Redirected to http://localhost:3000/users/sign_in
Completed 302 Found in 2102ms (ActiveRecord: 0.0ms)
Started GET "/users/sign_in" for 127.0.0.1 at 2012-08-27 10:42:32 +0300
Processing by Devise::SessionsController#new as HTML
Rendered devise/shared/_links.erb (1.0ms)
Rendered devise/sessions/new.html.erb within layouts/application (6.5ms)
Completed 200 OK in 21ms (Views: 19.6ms | ActiveRecord: 0.0ms)
我复制link =&gt; // <a href="http
//来自日志 - 所有作品
我犯了什么错误?
根据日志,我收到了一封信......但是在“... @ gmail.com”中没有任何信息到达
答案 0 :(得分:1)
至于开发mailevents,您可能需要在development.rb中设置smtp设置
请务必完整阅读以完全了解邮件
http://guides.rubyonrails.org/action_mailer_basics.html
玩得开心
答案 1 :(得分:1)
您是否尝试过在生产环境中发送?我遇到了同样的问题,当我在开发环境中时它会在日志中显示,但我实际上不会收到电子邮件。但是,在生产环境中它运行良好。对不起,这不是一个有用的答案,但我无法发表评论。