Python email 开发

 

 

	def send_email(self):
                self.emails='[email protected],[email protected]'
		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()

 

你可能感兴趣的:(python)