[boston-pig] Email error
Brook, Robert
Robert.Brook at ElectricInsurance.com
Fri Sep 8 13:41:21 MDT 2006
Can anyone explain the inconsistent error that I get with this email code
import smtplib
fromaddress='robert.brook at domain.com'
toaddress='robert.brook at domain.com'
msg="subject: Hello\n\n\This is the body of the message."
a=smtplib.SMTP('HostName',25)
a.sendmail(fromaddress,toaddress,msg)
a.quit()
If I run this code interactively it works.
I if make it into a email.py file I get the error message
AttributeError: 'module' object has no attribute 'SMTP'
Thanks in advance
More information about the boston-pig
mailing list