That email must open access for third-party applications at this link: https://myaccount.google.com/lesssecureapps
If it’s opened and still can’t be sent, Google may recognize the email sending machine’s IP as a strange IP and block it. Google will usually send an email to your mailbox to warn you about strange logins. You need to go to this email and confirm that the IP is safe to send email.