Net::SMTPAuthenticationError (535-5.7.8 Имя пользователя и пароль не принимаются. Подробнее см.): С почтовой программой devise
У меня странная проблема при работе с моим приложением. В моем приложении будет много опций почтовой программы, которые пишутся самостоятельно, и они отлично работают. Я использовал Devise gem Authentication, но такие письма, как (регистрация, забытый пароль, подтверждение), не работают. В конечном итоге проблема
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
# config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
:user_name => ENV['sendgrid_username'],
:password => ENV['sendgrid_password'],
:domain => '*****.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
Я не знаю, почему у меня проблема с почтовой программой devise, другие специальные почтовые программы работают нормально.
Выполнено 500 внутренних ошибок сервера за 10789 мс (ActiveRecord: 4434,0 мс | Распределения: 260142)
Net::SMTPAuthenticationError (535-5.7.8 Имя пользователя и пароль не принимаются. Подробнее см.):
Я унаследовал почту из своего почтового ящика, хотя у меня такая же проблема.
class UserMailer < ActionMailer::Base
include Devise::Mailers::Helpers
default from: "default@mydomain.com"
def confirmation_instructions(record, token, opts={})
@token = token
devise_mail(record, :confirmation_instructions, opts)
end
def reset_password_instructions(record, token, opts={})
@token = token
devise_mail(record, :reset_password_instructions, opts)
end
def unlock_instructions(record, token, opts={})
@token = token
devise_mail(record, :unlock_instructions, opts)
end
def email_changed(record, opts={})
devise_mail(record, :email_changed, opts)
end
def password_change(record, opts={})
devise_mail(record, :password_change, opts)
end
# you can then put any of your own methods here
end