#NEWLINE# def _send_mail( self , receivers_list , subject , body ) : #NEWLINE# #INDENT# 'Actually sends the mail with `subject` and `body` to all members of `receivers_list`.' #NEWLINE# msg = MIMEText ( body ) #NEWLINE# msg [ 'Subject' ] = subject #NEWLINE# msg [ 'From' ] = self . from_address #NEWLINE# msg [ 'To' ] = ', ' . join ( receivers_list ) #NEWLINE# s = None #NEWLINE# try : #NEWLINE# #INDENT# s = smtplib . SMTP ( self . smtp_uri ) #NEWLINE# s . sendmail ( self . from_address , receivers_list , msg . as_string ( ) ) #NEWLINE# #UNINDENT# except ( socket . gaierror , smtplib . SMTPException ) as e : #NEWLINE# #INDENT# raise PluginFailedException ( ( 'Error communicating with SMTP server: %s' % str ( e ) ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if ( s is not None ) : #NEWLINE# #INDENT# s . quit ( )