The server response was: 5.7.0 Authentication Required once I host it

I am using google SMTP and when I use it locally it works and it sends emails but when I host my website on amazon elastic beanstalk I receive this error

The server response was: 5.7.0 Authentication Required

I enabled the Less Secure Apps setting on google and I added all traffic on amazon outbound and inbound furthermore, I added the TCP port 587 on the outbound and inbound and I still get the same issue. Note(the website doesn't have SSL/TCL certification is it possible because of that)