used for the "latin unicode type earlier in this section--an encoding choice that is irrelevant to any recipient that understands the "latin synonymincluding python itself unfortunatelythat means that we also need to pass in different string type if we use synonym the package doesn' understand todaym mimetext('abc'_charset='latin- 'print(mmime-version content-typetext/plaincharset="iso- - content-transfer-encodingquoted-printable str for 'latin- abc mimetext('abc'_charset='latin 'traceback (most recent call last)lines omitted file " :\python \lib\email\base mime py"line in body_encode enc a_base ( [ : max_unencoded]decode("ascii"typeerrormust be bytes or buffernot str mimetext( 'abc'_charset='latin 'print(mcontent-typetext/plaincharset="latin mime-version content-transfer-encodingbase bytes for 'latin 'ywjj there are ways to add aliases and new encoding types in the email packagebut they're not supported out of the box programs that care about being robust would have to cross-check the user' spellingwhich may be valid for python itselfagainst that expected by email this also holds true if your data is not ascii in general--you'll have to first decode to text in order to use the expected "latin- name because its quotedprintable mime encoding expects streven though bytes are required if "latin triggers the default base mimem mimetext( ' \xe '_charset='latin 'print(mcontent-typetext/plaincharset="latin mime-version content-transfer-encodingbase qerc mimetext( ' \xe '_charset='latin- 'traceback (most recent call last)lines omitted file " :\python \lib\email\quoprimime py"line in body_encode if line endswith(crlf)typeerrorexpected an object with the buffer interface mimetext( ' \xe bdecode('latin ')_charset='latin- 'print(memailparsing and composing mail content