I have tried to attached a file to the mail using python. Code:
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIME
In my case was a host problem. Using debug mode, I spotted that in (host, port, 0, SOCK_STREAM) I got host=local and it should be host=localhost. In the run.py I defined localhost and the file hosts (c:\windows\system32\drivers\etc\hosts) was defined local. They have to be equal, otherwise you get the socket.gaieeror.