530 5.7.0必须首先发出STARTTLS命令。 (Ruby on Rails)

时间:2018-03-31 01:36:40

标签: ruby-on-rails ruby devise smtp



I've searched through a bunch of other posts about how to fix the STARTTLS error but everything I've tried doesn't seem to work. Can anyone help??? development.rb:
<br> require 'starttls'
<br> config.action_mailer.smtp_settings = {
<br> enable_starttls_auto: true,
<br> address: "smtp.gmail.com",
<br> port: 587,
<br> domain: "gmail.com",
<br> authentication: :plain,
<br> user_name: "myusername without the '@' and domain",
<br> password: "mypassword"
<br> }
<br> config.consider_all_requests_local = true
<br> config.action_mailer.default_url_options = {host: 'localhost:3000' }
<br> #Enable/disable caching. By default caching is disabled.
<br> config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors= true 
Inside of my devise.rb:
<br> config.mailer = 'Devise::Mailer'
<br> config.parent_mailer = 'ActionMailer::Base' 
&#13;
&#13;
&#13; 我已经通过我的Gmail帐户启用了应用程序访问权限(我怀疑是这个问题)。像ActionMailer这样的一些代码是因为我从一些较旧的帖子中获得了这些代码。我有enable_starttls_auto     为真,但它仍然返回错误。我试图做的主要动作是密码重置/恢复。     
我的红宝石版本:ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]     
我的rails版本:Rails 5.1.5     
我的设计版本:     
名称:设计     
版本:!ruby / object:Gem :: Version     
版本:4.4.3     
平台:ruby

0 个答案:

没有答案