This Go program successfully sends email from my home computer, but on a virtual server on DigitalOcean receives the following error:
panic: 530 5.5.1 Authen
in may case setting SMTPAuth to true fixed it. Of-course you need to set permissions for "Less secure apps" to Enabled.
$mail->SMTPAuth = true;