-
Notifications
You must be signed in to change notification settings - Fork 0
/
spambot.py
28 lines (24 loc) · 1019 Bytes
/
spambot.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
from Google import Create_Service
import base64
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
CLIENT_SECRET_FILE = 'client_secret.json'
API_NAME = 'gmail'
API_VERSION = 'v1'
SCOPES = ['https://mail.google.com/']
service = Create_Service(CLIENT_SECRET_FILE, API_NAME, API_VERSION, SCOPES)
#for i in range(1, 1000):
# recepient = '[email protected]'
# conv = str(i)
# while (len(conv) < 4):
# conv = '0' + conv
# recepient = 'f2020' + conv + '@hyderabad.bits-pilani.ac.in'
mimeMessage = MIMEMultipart()
mimeMessage['subject'] = 'Testing'
emailMsg = 'Consider yourself fortunate for being selected for testing of automated send scripts'
mimeMessage['to'] = '[email protected]'
mimeMessage.attach(MIMEText(emailMsg, 'plain'))
raw_string = base64.urlsafe_b64encode(mimeMessage.as_bytes()).decode()
message = service.users().messages().send(userId='me', body={'raw': raw_string}).execute()
print(message)
print('Spam completed successfully')