How to use the yagmail.error.YagAddressError 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 / yagmail / sender.py View on Github external
    @staticmethod
    def _make_addr_alias_user(email_addr):
        if isinstance(email_addr, text_type):
            if '@' not in email_addr:
                email_addr += '@gmail.com'
            return (email_addr, email_addr)
        if isinstance(email_addr, dict):
            if len(email_addr) == 1:
                return (list(email_addr.keys())[0], list(email_addr.values())[0])
        raise YagAddressError