Hey there Vera Dolan,
Thanks for reaching out to Apple Support Communities. I understand you’re getting an error when using Mail on your Mac. I’ll be happy to help with this.
It looks like this is related to your iCloud server settings. You can read more about this here:
Mail server settings for iCloud email clients
Open System Preferences on your Mac and click on Apple ID > Overview and then click Sign Out. Once the process is complete, boot your Mac into safe mode and sign back in:
Use safe mode to isolate issues with your Mac
See if this issue continues to occur. If not, restart as normal and test again.
I hope this helps.