logger = logging.getLogger()
gm = ThreadedTlsSMTPHandler(('smtp.gmail.com', 587), 'bugs@my_company.com',
    ['admin@my_company.com'], 'Error found!', (
    'my_company_account@gmail.com', 'top_secret_gmail_password'))
gm.setLevel(logging.ERROR)
logger.addHandler(gm)
try:
    1 / 0
except:
    logger.exception('FFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUU-')
How to make SMTPHandler not block