email.py 文件源码

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

项目:crisscross 作者: bhaveshAn 项目源码 文件源码
def _send(self, **kwargs):
        recipient = kwargs.get('recipient')
        subject = kwargs.get('subject')
        text = kwargs.get('text')

        uri = "mailto:"
        if recipient:
            uri += str(recipient)
        if subject:
            uri += "?" if not "?" in uri else "&"
            uri += "subject="
            uri += quote(str(subject))
        if text:
            uri += "?" if not "?" in uri else "&"
            uri += "body="
            uri += quote(str(text))

        try:
            os.startfile(uri)
        except WindowsError:
            print("Warning: unable to find a program able to send emails.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号