-
Notifications
You must be signed in to change notification settings - Fork 0
/
cqHack.py
47 lines (33 loc) · 1001 Bytes
/
cqHack.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
#!/usr/bin/python
# Made by cqHack
import smtplib
import time
from email.mime.text import MIMEText
server = raw_input("Enter smtp server url > ")
emailsFile = raw_input("Enter filename of emails > ")
content = raw_input("Enter filename of email body > ")
email = raw_input("Enter email of sender > ")
password = raw_input("Enter password of sender > ")
with open(content, "r") as f:
lines = f.readlines()
fromName = lines[0]
subject = lines[1]
msg = "\n".join(lines[2:])
server = smtplib.SMTP(server, '587')
server.ehlo()
server.starttls()
print("Logging in...")
server.login(email, password)
print("Login complete")
with open(emailsFile, "r") as f:
emails = f.readlines()
i = 0
for recipient in emails:
i += 1
mime = MIMEText(msg)
mime['Subject'] = subject
mime['From'] = fromName
mime['To'] = recipient
server.sendmail(email, recipient, mime.as_string())
print("On email: {}".format(i))
server.quit()