![]() |
"smtplib.SMTPServerDisconnected: please run connect() first"
I'm getting the error: smtplib.SMTPServerDisconnected: please run connect() first when I run code that is essentially identical to the code given in http://docs.python.org/library/email-examples.html The error happens at the line (copied verbatim from the example linked to above): s.sendmail(me, [you], msg.as_string()) What am I doing wrong? kynn P.S. I'm running this using v. 2.6.1. P.S.2. By "essentially identical" I mean that the only change I made to the original snippet was to initialize variables that are not initialized in the original (namely, textfile, me, and you) |
Re: "smtplib.SMTPServerDisconnected: please run connect() first"
kj wrote:
> > I'm getting the error: > > smtplib.SMTPServerDisconnected: please run connect() first > > when I run code that is essentially identical to the code given in > > http://docs.python.org/library/email-examples.html > > The error happens at the line (copied verbatim from the example > linked to above): > > s.sendmail(me, [you], msg.as_string()) > > What am I doing wrong? > > kynn > > P.S. I'm running this using v. 2.6.1. > > P.S.2. By "essentially identical" I mean that the only change I > made to the original snippet was to initialize variables that are > not initialized in the original (namely, textfile, me, and you) The line preceeding it, s = smtplib.SMTP() needs to have an e-mail server specified. E.g. s = smtplib.SMTP('localhost') # from the 2.5 docs Hope this helps! ~Ethan~ |
Re: "smtplib.SMTPServerDisconnected: please run connect() first"
In <mailman.1096.1255129309.2807.python-list@python.org> Ethan Furman <ethan@stoneleaf.us> writes:
>The line preceeding it, >s = smtplib.SMTP() >needs to have an e-mail server specified. E.g. >s = smtplib.SMTP('localhost') # from the 2.5 docs Perfect. Thanks! kynn |
| All times are GMT. The time now is 08:04 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.