[lug] python script to send email via SMTP

Michael J. Hammel mjhammel at graphics-muse.org
Tue Jul 17 14:57:54 MDT 2007


On Tue, 2007-07-17 at 11:51 -0600, Zan Lynx wrote:
> On Tue, 2007-07-17 at 11:21 -0600, Michael J. Hammel wrote:
> > I found the following script online.  I haven't learned Python yet, so I
> > can't tell if it should work or not, but it seems to at least try to
> > work.  The problem is I get the following traceback when it's run:
> 
> ssmtp might be a better program.  It's designed to just send email.
> ftp://ftp.debian.org/debian/pool/main/s/ssmtp/

Looks like this works better.  Apparently the python script didn't do
CRAM-MD5 authentication, which the server appears to want.  Or maybe it
did it incorrectly or something.  Anyway, ssmtp works as a replacement
for sendmail to just forward the message to a real mailhub that can
process the message correctly.

Thanks.
-- 
Michael J. Hammel                                    Senior Software Engineer
mjhammel at graphics-muse.org                           http://graphics-muse.org
------------------------------------------------------------------------------
Works well when under constant supervision and cornered like a rat in
a trap. -- From a real employee performance evaluation.




More information about the LUG mailing list