:param content_type: 如果 text 是html，则需要设置 _subtype='html'
        :param mail_to:
        :param subject:
        :param content:
        :param files: (f_name, f_data)
        :return:

def send_email(self, mail_to, subject, content, content_type='plain', files=None):
        """
        :param content_type: 如果 text 是html，则需要设置 _subtype='html'
        :param mail_to:
        :param subject:
        :param content:
        :param files: (f_name, f_data)
        :return:
        """
        assert type(mail_to) == list
        server = self.smtp_server
        if files is None:
            files = []

        msg = MIMEMultipart()
        msg['From'] = self.mail_from
        msg['To'] = ', '.join(mail_to)
        msg['Date'] = formatdate(localtime=True)
        msg['Subject'] = subject
        # 如果 text 是html，则需要设置 _subtype='html'
        # 默认情况下 _subtype='plain'，即纯文本
        msg.attach(MIMEText(content, _subtype=content_type, _charset='utf-8'))

        for fn, fd in files:
            part = MIMEText(fd, 'base64', 'utf-8')
            part["Content-Type"] = 'application/octet-stream'
            basename = fn
            if PY2:
                basename = basename.encode('gb2312')
            # 文件名使用 gb2312 编码，否则会没有附件
            part.add_header('Content-Disposition', 'attachment', filename=('gb2312', '', basename))
            msg.attach(part)
        smtp = smtplib.SMTP(server, port=self.smtp_port)
        smtp.sendmail(self.mail_from, mail_to, msg.as_string())
        smtp.close()