Skip to content

Instantly share code, notes, and snippets.

@joshdabosh
Last active October 21, 2018 13:47
Show Gist options
  • Save joshdabosh/24a592d73ae5bc15d68e2c09605e8bcc to your computer and use it in GitHub Desktop.
Save joshdabosh/24a592d73ae5bc15d68e2c09605e8bcc to your computer and use it in GitHub Desktop.
Sends 15 emails as a reminder whenever. Run (after filling in redactions) with python3 time_spammer.py &
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from datetime import datetime
import smtplib
import time
def email(sv, fe, fp, te, r):
msg = MIMEMultipart()
msg['From'] = fe
msg['To'] = te
msg['Subject'] = "Reminder"
msg.attach(MIMEText([REDACTED], "plain"))
s = smtplib.SMTP(sv, 587)
s.starttls()
s.login(fe, fp)
text = msg.as_string()
for i in range(r):
s.sendmail(fe, te, text)
s.quit()
return
def check():
while True:
n = str(datetime.now())
n = n.split()[1].split(":")[0].strip()
n = n.zfill(2)
if n == [SUB IN VALUE OF TIME]:
email("smtp.gmail.com", [REDACTED], [REDACTED], [REDACTED], 15)
print("emails sent")
time.sleep(8000)
check()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment