If you are using Safari, go to the Safari menu bar click Safari / Preferrences then select the Privacy tab.
Type appleid in the search field top right corner of that window then click Remove All > Done.
Restart your Mac.
Try opening Mail from the Dock.
If that didn't help, empty the Safari cache. See if that helps.