Tag: devise actionmailer

Rails ActionMailer在开发模式下具有Devise + Google Apps

我正在尝试将ActionMailer配置为使用我的Google Apps帐户以开发模式从Devise发送邮件。 我已将以下内容添加到我的config / environments / development.rb文件中,但看起来邮件没有被发送。 注意:这适用于Google Apps,而非Gmail(但Gmail服务器应该可以使用 – 它们可以在我的邮件客户端中使用)。 我的配置中有什么东西跳出来的? config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => “smtp.gmail.com”, :port => 587, :domain => “mydomain.com”, :authentication => :login, :user_name => “myemaiL@mydomain.com”, :password => “mypass” }

使用devise和Gmail smtp服务器发送邮件

我正在使用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’ […]