For SMTP the host should be *.mail.protection.outlook.com on port 25, .e.g.:
The information is from: https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide
On Micosoft Azure, you need to enter a new registration under App Registrations. On this you will then find the:
The registered app must then be enabled for access via POP3 and SMTP via “API Permissions”. Under Add Permission and then the tab “APIs used by my organization” there select “Office 365 Exchange Online”. then “Application permissions” and there you will find POP and SMTP.
After that you have to do the following in the power shell:
Install-Module -Name ExchangeOnlineManagement Install-Module -Name AzureAD Install-Module Microsoft.Graph Connect-AzureAD -TenantID <Ihre ID> Connect-ExchangeOnline -Organization <Ihre ID> # prüfen Get-AzureADServicePrincipal -SearchString "<Display name of your application id>" $MyApp = Get-AzureADServicePrincipal -SearchString "<Display of your application id>" New-ServicePrincipal -AppId $MyApp.AppId -ServiceID $MyApp.ObjectID -Display "Sercie Principal for POP3 App" Add-MailboxPermission -Identity "<login user>" -User $MyApp.ObjectId -AccessRights FullAccess