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

Solution: Import the 'MIMEMultipart' module

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

from email.mime.multipart import MIMEMultipart

 

For more information:
Python email MIMEMultipart