Email Settings doesn't get opened

When I go to ERPNext Settings and click Email Account, I get the below error stating, “The DocType to open might be delete”. What are the possible causes for this issue.

@ransikerandeni check this ImportError: cannot import name 'HeaderWriteError' from 'email.errors'