#NEWLINE# def check_requirements( self ) : #NEWLINE# #INDENT# 'Logs in to SMTP server to check credentials and settings' #NEWLINE# if self . use_ssl : #NEWLINE# #INDENT# server = smtplib . SMTP_SSL ( self . host , self . port ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# server = smtplib . SMTP ( self . host , self . port ) #NEWLINE# #UNINDENT# server . ehlo ( ) #NEWLINE# if self . use_starttls : #NEWLINE# #INDENT# server . starttls ( ) #NEWLINE# server . ehlo ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if self . login_required : #NEWLINE# #INDENT# server . login ( server . fromuser , self . frompwd ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# _logger . error ( 'Cannot connect to your SMTP account. Correct your config and try again. Error details:' ) #NEWLINE# _logger . error ( ex ) #NEWLINE# raise #NEWLINE# #UNINDENT# _logger . info ( 'SMTP server check passed' )