首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >中的Mailer

中的Mailer
EN

Stack Overflow用户
提问于 2015-07-06 07:40:33
回答 2查看 135关注 0票数 0

我正在将ROR3应用程序迁移到ROR4。我对此非常陌生,我也是随着迁移学到的。我被困在了第一步--我自己--我遇到了一个错误

代码语言:javascript
复制
Net::SMTPAuthenticationError in ClientsController#create
534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtq6

这是我在development.rb中的配置。

代码语言:javascript
复制
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

  ActionMailer::Base.smtp_settings = {
          :address              => "smtp.gmail.com",
          :port                 => 587,
          :domain               => "gmail.com",
          :user_name            => Rails.application.secrets.email_address,
          :password             => Rails.application.secrets.email_password,
          :authentication       => "plain",
          :enable_starttls_auto => true }

我得到错误的地方是

@client.save。

代码语言:javascript
复制
 Apartment::Tenant.create(@client.subdomain)
      Apartment::Tenant.switch(@client.subdomain)
      @client.save
      redirect_to new_user_session_url(subdomain: @client.subdomain)
    else
      render action: 'new'

有谁能帮上忙吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-07-06 07:41:56

我也有同样的问题,请务必查看您的gmail帐户安全设置并启用"Access for less secure apps" from www.google.com/settings/security."

票数 2
EN

Stack Overflow用户

发布于 2015-07-06 07:48:49

尝尝这个

代码语言:javascript
复制
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
     :address => "smtp.gmail.com",
     :port => 587,
     :user_name => "your mail",
     :password => "your password",
     :authentication => :plain,
     :enable_starttls_auto => true
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31240220

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档