def __init__(self, text, subtype, charset): self.encoding = charset MIMEText.__init__(self, text, subtype, charset)
def __init__(self, _text, _subtype='plain', _charset=None): MIMEText.__init__(self, _text, _subtype, 'us-ascii') # Only set the charset paraemeter to non-ASCII if the body # includes unprintable characters if notascii2.search(_text): self.set_param('charset', _charset)