-
Notifications
You must be signed in to change notification settings - Fork 0
/
invoice_anyone.py
52 lines (40 loc) · 1.29 KB
/
invoice_anyone.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import SimpleHTTPServer
import SocketServer
import cgitb
import cgi
import smtplib
import os
ms = raw_input("Enter your Text")
cgitb.enable()
PORT = 8000
class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
print "get"
FROM = "artemisfowl901@gmail.com"
TO = "samuelmayerhofer@gmail.com"
message = ms
username = "artemisfowl901@gmail.com"
password = "thelowerelements"
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(username, password)
server.sendmail(FROM, [TO], message)
server.quit()
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
def do_POST(self):
FROM = "artemisfowl901@gmail.com"
TO = "samuelmayerhofer@gmail.com"
message = ms
username = "artemisfowl901@gmail.com"
password = "thelowerelements"
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(username, password)
server.sendmail(FROM, [TO], message)
server.quit()
Handler = MyHandler
httpd = SocketServer.TCPServer(("", os.getenv(PORT,8080)), Handler)
print "serving at port", PORT
httpd.serve_forever()