def encode_transfer_encoding(encoding, body):
if encoding == 'quoted-printable':
return quopri.encodestring(body, quotetabs=False)
elif encoding == 'base64':
return email.encoders._bencode(body)
else:
return body
文章目录