#
# script to send emails to a single person from different people.
# developped as an easy way for me to earn 13% of my grade in ASC1000

import smtplib
from email.mime.text import MIMEText
from random import randint, choice
from time import sleep

smtpServer = #deleted
me = {'my_name': 'me_email_address'}
files = {'me': 'me.txt'}
to = #deleted

lis = me.keys()
while (len(lis) > 0):
    i = choice(lis)
    lis.remove(i)
    msg = MIMEMultipart('alternative')
    msg['Subject'] = 'Weekly email for UE'
    msg['From'] = me[i]
    msg['To'] = to

    fp = open(files[i], 'rb')
    text = MIMEText(fp.read())
    fp.close()

    msg.attach(text)

    s = smtplib.SMTP(smtpServer)
    s.sendmail(me[i], to, msg.as_string())
    s.quit()

    sleep(randint(60, 3600))

