problem with sending email

Steve Holden sholden at holdenweb.com
Tue Jul 3 09:45:23 EDT 2001


"Haris Lekatsas" <lekatsas at EE.Princeton.EDU> wrote in ...
> This works thanks!
>
> Unfortunately it makes my scripts less portable as the path to
> sendmail has to be specified (not always at /usr/sbin/sendmail)
> but this seems to be the only solution I have so far.
> I wonder if python's smtplib is broken.
>

Certainly not *that* broken. On Windows platforms it sends megabytes of mail
for me every month, some of it single messages with 2MB zipfile attachments.
Don't currently use it on Unix.

I notice in your original code you assemble the message line-by-line,
reading from a text file. You could think about

a) Putting debug outputs in there to see what message length is being passed
to SMPT.sendmail(), or

b) Using read() to suck the whole thing in - if line endings are a problem
you could use replace() to ensure they are correct.

But you really should check what sendmail() is being given, so you know
where to look next for the possible error.

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list