smtplib.SMTPDataError: (503, 'Error: need RCPT command')
Richard van de Stadt
stadt at cs.utwente.nl
Tue Oct 23 18:51:12 CEST 2001
Steve Holden wrote:
> mail = smtplib.SMTP(LocalMailServer)
> mail = smtplib.SMTP(altLocalMailServer)
> mail.sendmail(fromaddr, recipients, message % locals())
> smtplib line 386 raises an
> error because the server doesn't give the expected reply when the client
> starts to send the message body.
> To check this, try adding
> before the .sendmail() call, which will give you a trace of client/server
That hint helped.
Turns out the machine I was running this on doesn't have an smtp server.
Therefore smtplib.SMTP('localhost') didn't work out and raised an
exception, after which the altLocalMailServer was tried, which didn't
accept the request from this system (which is correct behavior :-)
Thanks a lot.
More information about the Python-list