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()
评论列表
文章目录