smtp.py 文件源码

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

项目:ws-backend-community 作者: lavalamp- 项目源码 文件源码
def test_authentication(self):
        """
        Check to see whether or not the currently configured SMTP credentials can be used
        to authenticate to the remote service.
        :return: True if the current configured SMTP credentials can be used to authenticate to
        the remote service, False otherwise.
        """
        connection = smtplib.SMTP(config.smtp_host, config.smtp_port)
        connection.ehlo()
        connection.starttls()
        try:
            connection.login(config.smtp_username, config.smtp_password)
            return True
        except smtplib.SMTPAuthenticationError:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号