How to Solve NameError: name 'Encoders' is not defined -- email

Solution: Import the 'Encoders' module

To Solve the error, add the following line to the top of your code.

from email import Encoders

 

For more information:
Python email Encoders