Rails Ruby 中的邮寄者
Mailer in Ruby on Rails
我正在将 ROR3 应用程序迁移到 ROR4。我对此很陌生,我正在随着迁移学习。
我自己陷入了第一步
我收到一个错误
Net::SMTPAuthenticationError in ClientsController#create
534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtq6
这是我在 development.rb 中的配置。
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.
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'
任何人都可以帮助正在研究 ROR 的人吗?
我遇到了同样的问题,请务必查看您的 gmail
帐户安全设置并启用 "Access for less secure apps" from www.google.com/settings/security."
试试这个
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
}
我正在将 ROR3 应用程序迁移到 ROR4。我对此很陌生,我正在随着迁移学习。 我自己陷入了第一步 我收到一个错误
Net::SMTPAuthenticationError in ClientsController#create
534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtq6
这是我在 development.rb 中的配置。
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.
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'
任何人都可以帮助正在研究 ROR 的人吗?
我遇到了同样的问题,请务必查看您的 gmail
帐户安全设置并启用 "Access for less secure apps" from www.google.com/settings/security."
试试这个
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
}