我在开发上有以下SMTP配置。rb
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.zoho.com",
:port => 465,
:user_name => "xxx@xxx.com",
:password => "xxxx",
:authentication => :login,
:ssl => true,
:tls => true,
:enable_starttls_auto => true
}
我通过Rails Console发送时工作,但会出现
的错误Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted. Learn more at
):
当我通过Mailer类发送时。
似乎Gmail在尝试通过控制器时暂时阻止您。
请与此链接进行检查
https://support.google.com/mail/answer/7126229?visit_id=1-63634247083592666666666666666666666666666666666668809045&pon
希望这会有所帮助。