Try this method:
Windows Defender Firewall should be turned off.
- Press the Windows key + S hotkey to make sure Windows Defender Firewall isn't preventing Outlook in any manner.
- Then, in the search box, type 'firewall' and choose to start Windows Defender Firewall.
- On the left side of the Control Panel window, click Turn Windows Defender Firewall on or off.
- To disable WDF, click both the Turn off Windows Defender Firewall radio options.
- To close the window, click the OK button.
I hope this method will fix the outlook error in window 10