Python email 开发
def send_email(self):self.emails='a1@b.c,a2@b.c'
msg = MIMEText(self.content)
msg['SUBJECT'] = self.subject
msg['TO'] = ', '.join(self.emails)
print(msg['TO'])
msg['FROM'] = self.sender
HOST = self.mailserver
self.write('sending email to '+msg['TO'])
server = smtplib.SMTP(HOST)
server.sendmail(msg['FROM'],self.emails,msg.as_string())
server.quit()
页:
[1]