diff options
| author | bwarsaw | 1999-11-24 21:17:29 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-11-24 21:17:29 +0000 |
| commit | 580e3512245103dcd5a286715e716cf1ae9eccfa (patch) | |
| tree | 9fcebddf2ee623d532b713861acd7c16f544d18f /Mailman/Message.py | |
| parent | 98a13dea932365c9678180ee6cd2c9893e2702c4 (diff) | |
| download | mailman-580e3512245103dcd5a286715e716cf1ae9eccfa.tar.gz mailman-580e3512245103dcd5a286715e716cf1ae9eccfa.tar.zst mailman-580e3512245103dcd5a286715e716cf1ae9eccfa.zip | |
Diffstat (limited to 'Mailman/Message.py')
| -rw-r--r-- | Mailman/Message.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Mailman/Message.py b/Mailman/Message.py index 9f6385aa7..ae73efc2f 100644 --- a/Mailman/Message.py +++ b/Mailman/Message.py @@ -96,6 +96,21 @@ class Message(rfc822.Message): class OutgoingMessage(Message): - def __init__(self): + def __init__(self, text=''): from Mailman.pythonlib.StringIO import StringIO - Message.__init__(self, StringIO()) + # NOTE: text if supplied must begin with valid rfc822 headers. It can + # also begin with the body of the message but in that case you better + # make sure that the first line does NOT contain a colon! + Message.__init__(self, StringIO(text)) + + + +class UserNotification(OutgoingMessage): + def __init__(self, recip, sender, subject=None, text=''): + OutgoingMessage.__init__(self, text) + if subject is None: + subject = '(no subject)' + self['Subject'] = subject + self['From'] = sender + self['To'] = recip + self.recips = [recip] |
