我正在使用Devise:确认和:可恢复模块来确认用户并让他在忘记密码时恢复密码.一切都很好,邮件生成,我可以在服务器日志中看到它,但然后我遇到错误,邮件没有传递到邮箱.我的environment.rb文件的SMTP设置是:
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true, #this is the important shit!
:address => 'smtp.gmail.com', #'localhost',
:port => 587,
:tls => true,
:domain => 'mail.google.com', # mail.customdomain.com if you use google apps
:authentication => :login,
:user_name => 'jatinkumar.nitk@gmail.com',
:password => '_secret_password'
}
Run Code Online (Sandbox Code Playgroud)
如果:地址是'smtp.gmail.com',那么我得到以下错误:
SocketError (getaddrinfo: Name or service not known):
Run Code Online (Sandbox Code Playgroud)
如果我将:address设置为'localhost',那么我会收到以下错误:
Errno::ECONNREFUSED Connection refused - connect(2)
Run Code Online (Sandbox Code Playgroud)
我不知道这是什么:地址意味着,所有这些东西的新手.在运行uname -a时,我得到了
Linux jatin-ubuntu 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 …Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中使用设计进行身份验证.当我尝试注册时,我收到以下错误:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
Run Code Online (Sandbox Code Playgroud)
我正在使用:comfirmable并且在迁移中没有注释t.confirmable