#NEWLINE# def _sendmail( self , to_addrs , msg ) : #NEWLINE# #INDENT# from twisted.mail.smtp import ESMTPSenderFactory #NEWLINE# msg = StringIO ( msg ) #NEWLINE# d = defer . Deferred ( ) #NEWLINE# factory = ESMTPSenderFactory ( self . smtpuser , self . smtppass , to_addrs . mailfrom , to_addrs , msg , d , heloFallback = True , requireAuthentication = False , requireTransportSecurity = self . smtptls ) #NEWLINE# factory . noisy = False #NEWLINE# if self . smtpssl : #NEWLINE# #INDENT# reactor . connectSSL ( self . smtphost , self . smtpport , factory , ssl . ClientContextFactory ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reactor . connectTCP ( self . smtphost , self . smtpport , factory ) #NEWLINE# #UNINDENT# return d