535-5.7.8仅在VPS上不接受用户名和密码

I've setup a Laravel project and setup SMTP (swift) mailing with Gmail. After setting up Gmail with 2-way auth and adding the app password it works locally in my Vagrant box. Now I've setup a VPS and it doesn't work in this environment. I'm getting this in the log:

Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted

I've tried finding a solution, but no success. Hope you can help..