Quickies

[categories] [index] [all (527)] [latest]

Python
  1. and cheat where you can...

    #!/usr/bin/python
    # -*- coding: iso-8859-1 -*-
    
    import smtplib
    import time
    
    from_addr = "tintin@bluewin.ch"
    to_addrs  = ["milou@vtx.ch"]
    date = time.ctime(time.time())
    
    msg = """From: "Georges W. Bush" <bush@whitehouse.gov>
    Subject: Secret plan
    Date: %s
    To: "Donald Rumsfeld" <rumsfeld@whitehouse.gov>
    X-Mailer: Apple Mail (2.733)
    
    This is a test
    
    é à
    """ % date
    
    s = smtplib.SMTP('smtp.bluewin.ch')
    
    s.set_debuglevel(1)
    
    s.sendmail(from_addr, to_addrs, msg)
    
    s.quit()