#NEWLINE# def _attempt_send( self , recipients , msg_string ) : #NEWLINE# #INDENT# attempts = 0 #NEWLINE# while ( attempts < 3 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# result = self . smtp . sendmail ( self . user , recipients , msg_string ) #NEWLINE# self . log . info ( 'Message sent to %s' , recipients ) #NEWLINE# self . num_mail_sent += 1 #NEWLINE# return result #NEWLINE# #UNINDENT# except smtplib . SMTPServerDisconnected as e : #NEWLINE# #INDENT# self . log . error ( e ) #NEWLINE# attempts += 1 #NEWLINE# time . sleep ( ( attempts * 3 ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . unsent . append ( ( recipients , msg_string ) ) #NEWLINE# return False