Email sending with Office 365
Since the end of 2022, Microsoft Office 365 / Exchange Online no longer supports basic authentication. This basic authentication simply means that the application sends a username and password with every request. Instead, a method based on OAuth must be used. The app (visual energy) must be registered by an administrator.
NOTICE

Registration with Exchange Online can only be carried out by an administrator with the appropriate permissions. This description is based on information current as of November 2022.
Microsoft may have changed the terminology or procedure in the meantime.
- In the Azure Portal, navigate to Microsoft Entra ID > App registrations.
- Create a new app registration. The recommended supported account type is “Accounts in this organisational directory only...”. For a redirect URI of type Web, enter the URL that corresponds to the visual energy project URL. In the visual energy system configuration, this redirect URI can be copied under Settings -> Email.
- Add the following Microsoft Graph API permissions:
- email – View users’ email addresses.
- IMAP.AccessAsUser.All – Read and write access to mailboxes via IMAP.
- offline_access – Retain access to data for which you have granted access.
- openid – Sign users in.
- SMTP.Send – Send emails from the mailbox using SMTP Auth.
- User.Read – Sign users in and read user profiles.
- Under Certificates & secrets, add a new client secret. Please copy this client secret, as it will no longer be accessible later on.
- The next step is to enter the IDs generated by the registration (application ID, directory ID) and the client secret into visual energy. The easiest way to do this is via the clipboard. Open a second window and, in visual energy, navigate to System configuration -> Email settings -> Email sending (SMTP). Here, select the Microsoft (SMTP) protocol.
- In Azure Directory > App Registrations, select the app you have just created and copy the IDs.
- You must now establish a connection to the mail server using the “Connect account” button. Select the mailbox user you wish to use. As described earlier, we recommend setting up a separate mailbox for visual energy. Please select this mailbox here. It is displayed under Connected account.