#NEWLINE# def message( self ) : #NEWLINE# #INDENT# encoding = ( self . encoding or settings . DEFAULT_CHARSET ) #NEWLINE# msg = SafeMIMEText ( self . body , self . content_subtype , encoding ) #NEWLINE# msg = self . _create_message ( msg ) #NEWLINE# msg [ 'Subject' ] = self . subject #NEWLINE# msg [ 'From' ] = self . extra_headers . get ( 'From' , self . from_email ) #NEWLINE# msg [ 'To' ] = self . extra_headers . get ( 'To' , ', ' . join ( self . to ) ) #NEWLINE# if self . cc : #NEWLINE# #INDENT# msg [ 'Cc' ] = ', ' . join ( self . cc ) #NEWLINE# #UNINDENT# 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# if ( name . lower ( ) in ( 'from' , 'to' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# msg [ name ] = value #NEWLINE# #UNINDENT# return msg