How to Solve NameError: name 'EmailMessage' is not defined -- django
Solution: Import the 'EmailMessage' module
To Solve the error, add the following line to the top of your code.
from django.core.mail import EmailMessage
For more information:
Python django EmailMessage