def sendEmail(self, streamUP = False ): mailer = smtplib.SMTP('smtp.gmail.com',587) #Sending email stuff goes here to = "" for name in TO_ADDRESS: to = to + name + ";" header = "To: " + to + "\n" + "From: " + FROM_ADDRESS + "\n" + "Subject: " if streamUP: header = header + EMAIL_SUBJECT[1] self.msg = fileWriter.getEmail(True) else: header = header + EMAIL_SUBJECT[0] self.msg = fileWriter.getEmail(False) mailer.ehlo() mailer.starttls() mailer.ehlo() mailer.login(FROM_ADDRESS, FROM_PASS) mailer.sendmail(FROM_ADDRESS, to, header + "\n" + self.msg) mailer.quit() return
def __init__(self, debug=False): self.fromAddr = FROM_ADDRESS self.toAddr = TO_ADDRESS self.msg = fileWriter.getEmail(False)