I have a nice simple script sending an email to a gmail address. Very simple and works fine from Python IDLE after running it.
After making it an exe with GUI2Exe (using py2exe and also cx_freeze) I get this Error:
Traceback (most recent call last):
File "something.py", line 4, in <module>
File "smtplib.pyc", line 46, in <module>
ImportError: No module named email.utils
It is not called email.py and I have nothing on my computer called like that (I've read everything regarding this issue)
I alse tryed forcing it both from something.py and smtplib.py too with:
opts = {'py2exe': { "includes" : ["email.utils"] }}
Makes no difference at all. Runs from IDLE great but after gui2exe...ERROR.
I do have this email directory in my Lib directory and it does contain utils. But this is obvious since from IDLE the script works fine.
Original script:
import smtplib
fromaddr = 'blablu@gmail.com'
toaddrs = 'blipblop@gmail.com'
msg = 'There was a terrible error that occured and I wanted you to know!'
# Credentials (if needed)
username = 'blablu'
password = 'passbla'
# The actual mail send
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
I'm sick of this by now, sorry. I have no idea at all what's happening.
Can someone tell me what am I doing wrong?