1def anon():
2 br = mechanize.Browser()
3
4 to = raw_input(R + "Enter the recipient address: ")
5 subject = raw_input("Enter the subject: ")
6 print "Message: "
7 message = raw_input(">")
8
9 #proxy = "http://127.0.0.1:8080"
10
11 url = "http://anonymouse.org/anonemail.html"
12 headers = "Mozilla/4.0 (compatible; MSIE 5.0; AOL 4.0; Windows 95; c_athome)"
13 br.addheaders = [('User-agent', headers)]
14 br.open(url)
15 br.set_handle_equiv(True)
16 br.set_handle_gzip(True)
17 br.set_handle_redirect(True)
18 br.set_handle_referer(True)
19 br.set_handle_robots(False)
20 br.set_debug_http(False)
21 br.set_debug_redirects(False)
22 #br.set_proxies({"http": proxy})
23
24 br.select_form(nr=0)
25
26 br.form['to'] = to
27 br.form['subject'] = subject
28 br.form['text'] = message
29
30 result = br.submit()
31
32 response = br.response().read()
33
34
35 if "The e-mail has been sent anonymously!" in response:
36 print "The email has been sent successfully!! \n The recipient will get it in up to 12 hours!"
37 else:
38 print "Failed to send email!"