#!/usr/bin/python # -- Rename this file mailpda.py if you're using Windows. import sys import httplib import urllib webhost = "PUT THE HOSTNAME OF YOUR PERSONAL WEB SPACE HERE" webpath = "/mailpda.php" password = "PUT A PASSWORD HERE" # ---------------------------------------- message = ( # all the command line arguments " ".join(sys.argv[1:]) or # ... or all of the standard input sys.stdin.read() ) headers = { "Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain" } conn = httplib.HTTPConnection(webhost) conn.request( "POST", webpath, urllib.urlencode({ "password": password, "message": message }), headers ) response = conn.getresponse() print "Response code: %s %s" % (response.status, response.reason) print response.read() conn.close()