becky_cli/becky/utils/notifier.py
def _send_smtp_notification(self, title, text):
        """
        Sends an email using smtp.
        """
        params = self.backup.notifier_params
        context = ssl.create_default_context()
        message = f'Subject: {title} \n\n {text}'
        try:
            server = smtplib.SMTP(params['smtp_server'], 587)
            server.ehlo()
            server.starttls(context=context)
            server.ehlo()
            server.login(params['sender_email'], params['smtp_password'])
            server.sendmail(params['sender_email'], params['receiver_email'], message)
        except Exception as e:
            import pdb;pdb.set_trace()
            print(e)
        finally:
            server.quit()

        Sends an email using smtp.
        
Sends an email using smtp.
Sends an email using smtp .
def _send_smtp_notification(self, title, text):
        params = self.backup.notifier_params
        context = ssl.create_default_context()
        message = f'Subject: {title} \n\n {text}'
        try:
            server = smtplib.SMTP(params['smtp_server'], 587)
            server.ehlo()
            server.starttls(context=context)
            server.ehlo()
            server.login(params['sender_email'], params['smtp_password'])
            server.sendmail(params['sender_email'], params['receiver_email'], message)
        except Exception as e:
            import pdb;pdb.set_trace()
            print(e)
        finally:
            server.quit()
def _send_smtp_notification ( self , title , text ) : params = self . backup . notifier_params context = ssl . create_default_context ( ) message = f'Subject: {title} \n\n {text}' try : server = smtplib . SMTP ( params [ 'smtp_server' ] , 587 ) server . ehlo ( ) server . starttls ( context = context ) server . ehlo ( ) server . login ( params [ 'sender_email' ] , params [ 'smtp_password' ] ) server . sendmail ( params [ 'sender_email' ] , params [ 'receiver_email' ] , message ) except Exception as e : import pdb ; pdb . set_trace ( ) print ( e ) finally : server . quit ( )
Sends an email using smtp.
Sends an email using smtp .
"""
        Sends an email using smtp.
        """
self
title
text