Reputation: 16212
This line is throwing a gaierror... any idea why? Could it be a firewall?
smtp=smtplib.SMTP(host=EMAIL_HOST,port=EMAIL_PORT)
I'm using gmail so the host is 'alt1.gmail-smtp-in.l.google.com', and the port is 587.
Upvotes: 2
Views: 1942
Reputation: 1088
Even if this weren't a gaierror (which, as AJ rightly says is a DNS lookup error), that host doesn't work for me either.
Specifically, it hangs trying to connect and times out.
However, the following seems to work:
import smtplib
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
smtp=smtplib.SMTP(host=EMAIL_HOST,port=EMAIL_PORT)
Hope that helps.
Upvotes: 1