#NEWLINE# def _send( self , email_message ) : #NEWLINE# #INDENT# 'A helper method that does the actual sending.' #NEWLINE# if ( not email_message . recipients ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# from_email = email_message . from_email #NEWLINE# if hasattr ( message , 'sanitize_address' ) : #NEWLINE# #INDENT# from_email = message . sanitize_address ( recipients . from_email , email_message . encoding ) #NEWLINE# #UNINDENT# if hasattr ( settings , 'TEST_EMAIL_TO' ) : #NEWLINE# #INDENT# email_message . to = settings . TEST_EMAIL_TO #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# email_message . to = dict ( getattr ( settings , 'ADMINS' , ( ) ) ) . values ( ) #NEWLINE# #UNINDENT# email_message . cc = getattr ( settings , 'TEST_EMAIL_CC' , [ ] ) #NEWLINE# email_message . bcc = getattr ( settings , 'TEST_EMAIL_BCC' , [ ] ) #NEWLINE# if hasattr ( message , 'sanitize_address' ) : #NEWLINE# #INDENT# recipients = [ message . sanitize_address ( addr , email_message . encoding ) for addr in email_message . recipients ( ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# recipients = email_message . recipients ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . connection . sendmail ( from_email , recipients , email_message . message ( ) . as_string ( ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# if ( not self . fail_silently ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# return False #NEWLINE# #UNINDENT# return True