Commit 4fed7be7 authored by Fardale's avatar Fardale

Correction mel de contact

parent 8fd1c0e2
......@@ -34,20 +34,17 @@ def checkPaper():
def sendMel(msgfile, etat):
fp = open(msgfile, 'rb')
# Create a text/plain message
msg = MIMEText(fp.read())
fp.close()
# me == the sender's email address
# you == the recipient's email address
me = 'oison@crans.org'
dest = 'respbats@crans.org'
msg['Subject'] = '''Etat de l'imprimante thermique : %s''' % etat
msg['From'] = 'oison@crans.org'
msg['To'] = 'arrighi@crans.org'
msg['From'] = me
msg['To'] = dest
# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP('smtp.crans.org', 25)
s.sendmail('oison@crans.org', ['arrighi@crans.org'], msg.as_string())
s.sendmail(me, [dest], msg.as_string())
s.quit()
def checkPrinter(dejaVu, messageCourant, messagePapier):
......@@ -111,7 +108,7 @@ if __name__ == "__main__":
print("fork #2 failed: %d (%s)" % (e.errno, e.strerror),file=sys.stderr)
sys.exit(1)
# start the daemon thread
# start the daemon thread to monitor the printer
thHasPaper = threading.Thread(target = checkPaper, name = 'checkPaper')
thHasPaper.start()
#main loop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment