the smtplib module accepts email content to send as str strings internallymessage text passed in str form is encoded to binary bytes for transmission using the ascii encoding scheme passing an already encoded bytes string to the send call may allow more explicit control composing the email package produces unicode str strings containing plain text when generating full email text for sending with smtplib and accepts optional encoding specifications for messages and their partswhich it applies according to email standard rules message headers may also be encoded per emailmimeand unicode conventions parsing the email package in currently requires raw email byte strings of the type fetched with poplib to be decoded into unicode str strings as appropriate before it can be passed in to be parsed into message object this pre-parse decoding might be done by defaultuser preferencemail headers inspectionor intelligent guess because this requirement raises difficult issues for package clientsit may be dropped in future version of email and python navigating the email package returns most message components as str stringsthough parts content decoded by base and other email encoding schemes may be returned as bytes stringsparts fetched without such decoding may be str or bytesand some str string parts are internally encoded to bytes with scheme raw-unicode-escape before processing message headers may be decoded by the package on request as well if you're migrating email scripts (or your mindsetfrom xyou'll need to treat email text fetched from server as byte stringsand encode it before passing it along for parsingscripts that send or compose email are generally unaffected (and this may be the majority of python email-aware scripts)though content may have to be treated specially if it may be returned as byte strings this is the story in python which is of course prone to change over time we'll see how these email constraints translate into code as we move along in this section suffice it to saythe text on the internet is not as simple as it used to bethough it probably shouldn' have been anyhow popfetching email confessup until just before took lowest-common-denominator approach to email preferred to check my messages by telnetting to my isp and using simple command-line email interface of coursethat' not ideal for mail with attachmentspicturesand the likebut its portability was staggering--because telnet runs on almost popfetching email