ImportError: No module named mime.multipart

It should now be done like this:

from email.mime.multipart import MIMEMultipart

Same goes for other commonly used modules like MIMEText and MIMEBase (use .text and .base respectively).

enter image description here


Well, from the docs for Python 2.4, it seems you need:

from email.MIMEMultipart import MIMEMultipart

(Although you might want to use a newer version of Python, if possible).


Module reorganization. The convention is for module names to be lower case, so some got renamed. In this case, the module you're looking for in Python 2.4.3 is email.MIMEMultipart.

Here's the docs from back then, in case the API has changed.


Call me dumb, but I was getting ImportError: No module named mime.text because my script was called email.py .... lol (blame on 4 am programming)

Tags:

Python

Email