How To: Google Apps for Business Settings for Self Hosted Installations

This took me a little while to figure out so hopefully it will help others.

If you have two step authentication enabled then you will also need to set an app password (see https://support.google.com/accounts/answer/185833)

Enable Less Secure Apps

  1. Log in to your Google Apps for Business admin console.
  2. Go to Security --> Basic Settings --> Under Less secure apps click on Go to settings for less secure apps >>
  3. Select Allow users to manage their access to less secure apps and click Save.
  4. Browse to https://www.google.com/settings/security/lesssecureapps and turn it on.

Enable SMTP Access

  1. Log in to your Google Apps for Business admin console.
  2. Go to Apps --> Google Apps --> G-Mail --> Advanced Settings then scroll down until you see SMTP relay service, however over it and click on Configure.
  3. Select Only addresses in my domains then tick Require SMTP Authentication and Require TLS encryption and click on Add Setting then click Save.

Configure .env which is located in the root of your Invoice Ninja installation.

MAIL_DRIVER=smtp MAIL_PORT=587 MAIL_ENCRYPTION=tls MAIL_HOST=smtp-relay.gmail.com MAIL_USERNAME=username@yourdomain.com MAIL_FROM_NAME=username@yourdomain.com MAIL_PASSWORD=yourpassword

Thanks for sharing this, I’ve seen a few other users run into this problem.