Ruby on Rails Devise 发送邮件
我一直在关注有关如何设置 Devise 的教程。我可以创建一个新的用户和电子邮件并点击提交。它显示“用户成功创建”,在服务器日志中我可以看到刚刚发送的电子邮件,其中包含主题、用户的电子邮件地址、用户名称等,并且显示“在 434 毫秒内完成 302 发现”。我不知道问题是什么,因为尽管用户已保存到数据库中,但我没有收到电子邮件。我正在使用 Gmail 发送电子邮件。
这是服务器日志(出于隐私原因,将电子邮件地址更改为 ---):
发送邮件至 [电子邮件受保护](389 毫秒)
日期:周五, 2011 年 8 月 12 日 09:11:45 -0500
来自:[电子邮件受保护]
致:<一href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e0cdcdcdcdcdcdcda0cdcdcdcdcdcdcdce838f8d">[电子邮件受保护]
消息 ID:[电子邮件受保护]>
主题:注册
Mime 版本:1.0
内容类型:text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
感谢您注册!
重定向到 http://127.0.0.1:3000/users/4
在 434 毫秒内完成 302 发现
任何人知道如何解决或认识到问题吗?
I've been following this tutorial on how to setup Devise. I'm able to make a new User&Email and hit submit. It says "User succesfully created" and in the server log I can see the email that was just sent with subject, email adress to user, name of user etc and it says "Completed 302 Found in 434ms". I don't know what the problem is though because I don't receive an email, although the user gets saved to the database. I'm using gmail to send email.
This is the server log (Changed email addresses to --- for privacy):
Sent mail to [email protected] (389ms)
Date: Fri, 12 Aug 2011 09:11:45 -0500
From: [email protected]
Message-ID: <[email protected]>
Subject: Registered
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Thank you for registering!
Redirected to http://127.0.0.1:3000/users/4
Completed 302 Found in 434ms
Anyone know how it could be solved or recognize the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您检查过 config/environment/development.rb 文件吗?确保 config.action_mailer.perform_deliveries 设置为 true。请参阅下文:
否则,该邮件可能已实际发送,并且您的电子邮件帐户正在默默地丢弃该邮件。打开上面的第一个选项(…raise_delivery_errors = true)来查看。
Have you checked your config/environment/development.rb file? Make sure that config.action_mailer.perform_deliveries is set to true. See below:
Otherwise, it's likely actually being sent and your email account is dropping the message silently. Turn up the first option above (…raise_delivery_errors = true) to see.