ngamsSmtpLib.py 文件源码

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

项目:ngas 作者: ICRAR 项目源码 文件源码
def mail(self,
             sender,
             options = []):
        """
        SMTP 'mail' command -- begins mail xfer session.

        sender:   Send of the mail (string).

        options:  List with mail options in the form: '<par>=<val>'
                  (list/string).

        Returns:  See smptplib.SMTP().getreply().
        """
        # NG/AMS: Replace the size=<Size> with the size of the data file
        # in case data is contained in a file.
        for i in range(len(options)):
            option = options[i]
            if (option.find("size=") and self.__msgInFile):
                int(os.stat(self.__dataFile)[6])
                options[i] = "size=" + str(os.stat(self.__dataFile)[6])
                break

        optionlist = ''
        if options and self.does_esmtp:
            optionlist = ' ' + ' '.join(options)
        self.putcmd("mail", "FROM:%s%s" % (smtplib.quoteaddr(sender),
                                           optionlist))
        return self.getreply()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号