#NEWLINE# @ property #NEWLINE# def mime( self ) : #NEWLINE# #INDENT# 'Produce the final MIME message.' #NEWLINE# author = sender . author #NEWLINE# sender = self . sender #NEWLINE# if ( not author ) : #NEWLINE# #INDENT# raise ValueError ( 'You must specify an author.' ) #NEWLINE# #UNINDENT# if ( not self . subject ) : #NEWLINE# #INDENT# raise ValueError ( 'You must specify a subject.' ) #NEWLINE# #UNINDENT# if ( len ( self . recipients ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'You must specify at least one recipient.' ) #NEWLINE# #UNINDENT# if ( not self . plain ) : #NEWLINE# #INDENT# raise ValueError ( 'You must provide plain text content.' ) #NEWLINE# #UNINDENT# if ( ( not self . _dirty ) and self . _processed ) : #NEWLINE# #INDENT# return self . _mime #NEWLINE# #UNINDENT# self . _processed = False #NEWLINE# plain = MIMEText ( self . _callable ( self . plain ) , 'plain' , self . encoding ) #NEWLINE# rich = None #NEWLINE# if self . rich : #NEWLINE# #INDENT# rich = MIMEText ( self . _callable ( self . rich ) , 'html' , self . encoding ) #NEWLINE# #UNINDENT# message = self . _mime_document ( plain , rich ) #NEWLINE# headers = self . _build_header_list ( author , sender ) #NEWLINE# self . _add_headers_to_message ( message , headers ) #NEWLINE# self . _mime = message #NEWLINE# self . _processed = True #NEWLINE# self . _dirty = False #NEWLINE# return message