"Mail error: The following From address failed: @gmail.com : MAIL not accepted from server,530,5.7.0 Authentication Required. Learn more at\r\n530 5.7.0 https:\/\/support.google.com\/mail\/?p=WantAuthError o7sm3762758qkd.64 - gsmtp\r\n
Even if you set the write credentials you still need to turn off the google's account security for some apps:
using the link: https://myaccount.google.com/lesssecureapps
In this way you will be able to send e-mails using a google account.