[Tutor] another intresting script

Kirk Bailey deliberatus@my995internet.com
Tue, 11 Dec 2001 11:19:08 -0500


ok, I copied this from the online reference, and messed with it and
messed with it, and the hound won't hunt.
---------------begin pooping------------------
#!/usr/local/bin/python
    import smtplib
    import string

    def prompt(prompt):
        return raw_input(prompt)string.strip()

    fromaddr = prompt("From: ")
    toaddrs  = prompt("To: ").split()
    print "Enter message, end with ^D:"

    # Add the From: and To: headers at the start!
    msg = ("From: %s\r\nTo: %s\r\n\r\n"
           % (fromaddr, string.join(toaddrs, ", ")))
    while 1:
        try:
            line = raw_input()
        except EOFError:
            break
        if not line:
            break
        msg = msg + line

    print "Message length is " + `len(msg)`

    server = smtplib.SMTP('localhost')
    server.set_debuglevel(1)
    server.sendmail(fromaddr, toaddrs, msg)
    server.quit()
-----------------end of poop-----------------------
thing refuses to include a newline character to the variable! bad token
stuff galore!

-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/