I try to send Devise email through Gmail. From Rails console in development mode on localhost it sends OK, but in production from other machine in a cloud it raises the error. I've enabled in Google not trusted application access. I use the same account for both envs with right the same smtp parameters.
> ActionMailer::Base.smtp_settings
=> {:address=>"smtp.gmail.com", :port=>587, :domain=>"example.com", :authentication=>"plain", :enable_starttls_auto=>true, :user_name=>"xxxx@gmail.com", :password=>"yyyy"}
> user.send_reset_password_instructions
PS I also tried this link from my localhost https://accounts.google.com/DisplayUnlockCaptcha but it doesn't resolve this issue. Perhaps I should use it from my production machine? But how? My production box is headless Ubuntu server.