#NEWLINE# def encode_7bit( self , encoder = None ) : #NEWLINE# #INDENT# '.. versionadded:: 0.3.12\n\n        Forces the message into 7-bit encoding such that it can be sent to SMTP\n        servers that do not support the ``8BITMIME`` extension.\n\n        If the ``encoder`` function is not given, this function is relatively\n        cheap and will just check the message body for 8-bit characters\n        (raising :py:exc:`UnicodeDecodeError` if any are found).  Otherwise,\n        this method can be very expensive. It will parse the entire message\n        into MIME parts in order to encode parts that are not 7-bit.\n\n        :param encoder: Optional function from :mod:`email.encoders` used to\n                        encode MIME parts that are not 7-bit.\n        :raises: UnicodeDecodeError\n\n        ' #NEWLINE# try : #NEWLINE# #INDENT# self . message . decode ( 'ascii' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# if ( not encoder ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# self . _encode_parts ( encoder )