How to use the yagmail.Connect function in yagmail

To help you get started, we’ve selected a few yagmail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kootenpv / yagmail / tests / runTests.py View on Github external
def previewAll():
    """ 
    Tests are only going to pass for "me"  at this point. 
    I very much will change that in the future
    """
    yag = yagmail.Connect() 
    mail_combinations = getCombinations(yag)
    passed = 0
    failed = 0
    for combination in mail_combinations:
        try: 
            yag.send(**combination)
            passed += 1
        # pylint: disable=broad-except
        # Ignoring broad except because I just want to see all the errors    
        except Exception as e:
            failed += 1
            print(e)
            print(combination)
    print('{} tests passed, {} failed'.format(passed, failed))