utils.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:django-anymail 作者: anymail 项目源码 文件源码
def formataddr(self, encoding=None):
        """Return a fully-formatted email address, using encoding.

        This is essentially the same as :func:`email.utils.formataddr`
        on the EmailAddress's name and email properties, but uses
        Django's :func:`~django.core.mail.message.sanitize_address`
        for improved PY2/3 compatibility, consistent handling of
        encoding (a.k.a. charset), and proper handling of IDN
        domain portions.

        :param str|None encoding:
            the charset to use for the display-name portion;
            default None uses ascii if possible, else 'utf-8'
            (quoted-printable utf-8/base64)
        """
        return sanitize_address((self.display_name, self.addr_spec), encoding)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号