bad python modules

Mon Nov 13 22:04:12 CET 2000

sp00fD wrote:

>   ...
>The database modules also seem lacking.  Sending mail using the smtp
>module leaves an empty subject line and occassional missing characters
>or extra spaces, whereas in perl, the available mailers work
>perfectly.  Is there a reason for this, or an effort to change it?
>With ActiveState in the picture, can we expect more robust replacements
>   ...

Though I'm still new to Python, I've had no trouble with the smtplib module.
I use code like the following (which I read about somewhere, probably in
this forum, thanks!) and have been sending quite a bit of mail with all
subject lines intact and no missing characters. (Although I would prefer a
separate subject property rather than lumping it in with the message. The
word "Subject:" gets stripped out automagically, though, so it works fine.)

def mailmsg():
    import smtplib

    msg = "Subject: Dead Parrot\n\n"
    msg = msg + "It's not dead, it's sleeping."
    mailfrom = "me at"
    mailto = "you at"
    host = "" 			# SMPT mail host

    server = smtplib.SMTP(host)
    server.sendmail(mailfrom, [mailto], msg)

More information about the Python-list mailing list