使用gmail的rails3上的devise的确认电子邮件不到 [英] Confirmation email from devise on rails3 using gmail not arriving
问题描述
我已经设置了以下内容。
--------------- -------
config / environments / development.rb
----------------------
29 ActionMailer :: Base.delivery_method =:smtp
30 ActionMailer :: Base.perform_deliveries = true
31 ActionMailer :: Base.raise_delivery_errors = true
32
33 ActionMailer :: Base.smtp_settings = {
34:enable_starttls_auto =>真的,#这是重要的东西!
35:address => 'smtp.gmail.com',
36:port => 587,
37:domain => 'foo.com',
38:authentication => :plain,
39:user_name => '---@---.---',
40:password => '---'
41}
然而,当设计发送确认邮件webbrick打印出来
日志中的电子邮件没有错误,但电子邮件不会在我的收件箱或垃圾邮件收件箱中最终
。
任何想法? p>
编辑:
我现在得到
Net :: SMTPAuthenticationError(530 5.7.0必须首先发出STARTTLS命令x13sm2646038bki.0
):
我发现
-------- --------------
config / environments / development.rb
--------------------- -
17#不关心邮件程序是否不能发送
18 config.action_mailer.raise_delivery_errors = false
在配置文件中设置得更高。但是这是关于发出STARTTLS命令的呢?
解决方案:
----------------------
config / environments / development.rb
------------ ----------
26 require'tlsmail'#key但不总是描述
27 Net :: SMTP.enable_tls(OpenSSL :: SSL :: VERIFY_NONE)
28
29 ActionMailer :: Base.delivery_method =:smtp
30 ActionMailer :: Base.perform_deliveries = true
31 ActionMailer :: Base.raise_delivery_errors = true
32
33 ActionMailer :: Base.smtp_settings = {
34:enable_starttls_auto =>真的,#这是重要的东西!
35:address => 'smtp.gmail.com',
36:port => 587,
37:domain => 'xtargets.com',
38:authentication => :plain,
39:user_name => '-------',
40:password => '-------'
41}
42
我有同样的问题;在我的情况下是由于一个错误(Net :: SMTP不怎么说TLS,这是gmail需要的),我解决了它,如解释这里。
I've set the following up.
----------------------
config/environments/development.rb
----------------------
29 ActionMailer::Base.delivery_method = :smtp
30 ActionMailer::Base.perform_deliveries = true
31 ActionMailer::Base.raise_delivery_errors = true
32
33 ActionMailer::Base.smtp_settings = {
34 :enable_starttls_auto => true, #this is the important stuff!
35 :address => 'smtp.gmail.com',
36 :port => 587,
37 :domain => 'foo.com',
38 :authentication => :plain,
39 :user_name => '---@---.---',
40 :password => '---'
41 }
However when devise sends the confirmation email webbrick prints out the email in the log with no error but the email does not end up in my inbox or spam inbox.
Any ideas?
EDIT:
I now get
Net::SMTPAuthenticationError (530 5.7.0 Must issue a STARTTLS command first. x13sm2646038bki.0
):
I found that
----------------------
config/environments/development.rb
----------------------
17 # Don't care if the mailer can't send
18 config.action_mailer.raise_delivery_errors = false
Had been set higher up in the config file. However what is this about issuing a STARTTLS command?
SOLUTION:
----------------------
config/environments/development.rb
----------------------
26 require 'tlsmail' #key but not always described
27 Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
28
29 ActionMailer::Base.delivery_method = :smtp
30 ActionMailer::Base.perform_deliveries = true
31 ActionMailer::Base.raise_delivery_errors = true
32
33 ActionMailer::Base.smtp_settings = {
34 :enable_starttls_auto => true, #this is the important stuff!
35 :address => 'smtp.gmail.com',
36 :port => 587,
37 :domain => 'xtargets.com',
38 :authentication => :plain,
39 :user_name => '-------',
40 :password => '-------'
41 }
42
Brad
I had the very same problem; in my case was due to a bug (Net::SMTP does not how to speak TLS, which is required by gmail) and I solved it as explained here.
这篇关于使用gmail的rails3上的devise的确认电子邮件不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!