email_test.py

This Python script sends an email message through a GoDaddy.com relay server. The server checks your internet address to verify that you are an actual GoDaddy client.


01: #!/usr/bin/python
02: import smtplib
03: import string, sys
04: import cgitb
05: cgitb.enable()
06: sys.stderr = sys.stdout
07: 
08: 
09: print 'Content-Type: text/plain'
10: print
11: 
12: HOST = "relay-hosting.secureserver.net"
13: 
14: 
15: FROM= "loomis@spam.egg"
16: 
17: TO= "ece538@spam.egg"
18: 
19: SUBJECT = "for your information"
20: 
21: BODY = "next week: how to fling an otter"
22: 
23: body = string.join((
24:     "From: %s" % FROM,
25:     "To: %s" % TO,
26:     "Subject: %s" % SUBJECT,
27:     "",
28:     BODY), "\r\n")
29: 
30: print body
31: 
32: server = smtplib.SMTP(HOST)
33: server.sendmail(FROM, [TO], body)
34: server.quit()
35: 


Maintained by John Loomis, updated Thu Mar 06 23:54:18 2008