def __init__(self, text): self.fromaddr = config.getConfigInfo("NAO mail", "compte") self.toaddr = config.getConfigInfo("Contact list", "user1") self.msg = MIMEMultipart() self.msg["Subject"] = "Nao assistant : aide a la personne" self.msg["From"] = self.fromaddr self.msg["To"] = self.toaddr self.msg.attach(MIMEText(text))
def __init__(self, text): self.fromaddr = config.getConfigInfo("NAOmail", "compte") self.toaddr = config.getConfigInfo("Contact list", "user1") self.msg = MIMEMultipart() self.msg['Subject'] = "Robot assistant" self.msg['From'] = self.fromaddr self.msg['To'] = self.toaddr self.msg.attach(MIMEText(text))
def sendMail(self): srv = config.getConfigInfo("ServerSMTP", "server") self.s = smtplib.SMTP(srv) # 465,587) #self.s.ehlo() #self.s.starttls() #self.s.ehlo() pwd = config.getConfigInfo("NAOmail", "pwd") self.s.login(self.fromaddr, pwd) self.s.sendmail(self.fromaddr, self.toaddr, self.msg.as_string()) self.s.quit()
def sendMail(self): srv = config.getConfigInfo("Server SMTP", "server") self.s = smtplib.SMTP(srv) # 465,587) # self.s.ehlo() # self.s.starttls() # self.s.ehlo() # pwd = config.getConfigInfo("NAO mail", "pwd") # self.s.login(self.fromaddr, pwd) self.s.sendmail(self.fromaddr, self.toaddr, self.msg.as_string()) self.s.quit()
def sendmsg(self, target, action, key=None, value=None): addr = config.getConfigInfo(target, "xaaladdr") msg = Message() msg.setTargets([addr]) msg.setDevtype('cli.experimental') msg.setMsgtype('request') msg.setAction(action) if(key != None and value != None) : body = {key:value} msg.setBody(body) msg.setSource(self.uuid) msg.setCipher("") msg.setSignature() txt = {"header":msg.getHeader(), "body":msg.getBody()} data = json.encode(txt) self.app.getNetworkConnector().send(data)
def sendmsg(self, target, action, key=None, value=None): addr = config.getConfigInfo(target, "xaaladdr") #hdrware addr of the equpmt msg = Message() msg.set_targets([addr]) msg.set_devtype('cli.experimental') msg.set_msgtype('request') msg.set_action(action) if(key != None and value != None) : body = {key:value} msg.set_body(body) msg.set_source(self.uuid) #msg.set_cipher_key("") #msg.set_signature() txt = {"header":msg.get_header(), "body":msg.get_body()} data = json.encode(txt) #addr 224.0.29.200, port 1235 self.app.get_network_connector().send(data)
def smartDeviceAction(self, device, action): addr = config.getConfigInfo(device, "xaaladdr") #hdrware addr of the equpmt print addr self.engine.send_request(self.dev, [addr], action, None)