#NEWLINE# def message( self ) : #NEWLINE# #INDENT# encoding = ( self . encoding or settings . DEFAULT_CHARSET ) #NEWLINE# msg = SafeMIMEText ( smart_str ( self . body , settings . DEFAULT_CHARSET ) , self . content_subtype , encoding ) #NEWLINE# msg = self . _create_message ( msg ) #NEWLINE# msg [ 'Subject' ] = self . subject #NEWLINE# msg [ 'From' ] = self . extra_headers . pop ( 'From' , self . from_email ) #NEWLINE# msg [ 'To' ] = ', ' . join ( self . to ) #NEWLINE# header_names = [ key . lower ( ) for key in self . extra_headers ] #NEWLINE# if ( 'date' not in header_names ) : #NEWLINE# #INDENT# msg [ 'Date' ] = formatdate ( ) #NEWLINE# #UNINDENT# if ( 'message-id' not in header_names ) : #NEWLINE# #INDENT# msg [ 'Message-ID' ] = make_msgid ( ) #NEWLINE# #UNINDENT# for ( name , value ) in self . extra_headers . items ( ) : #NEWLINE# #INDENT# msg [ name ] = value #NEWLINE# #UNINDENT# return msg