iro/model/message.py
branchdevel
changeset 192 6c708c334f37
parent 169 aabc04843d25
child 193 e5ec4bfa4929
equal deleted inserted replaced
191:1816e97881ce 192:6c708c334f37
    56 class Mail(Message):
    56 class Mail(Message):
    57     def __init__(self, subject, body, frm):
    57     def __init__(self, subject, body, frm):
    58         con=MIMEText(body.encode("utf-8"), _charset='utf-8')
    58         con=MIMEText(body.encode("utf-8"), _charset='utf-8')
    59         sub=Header(subject.encode('utf-8'), 'utf-8')
    59         sub=Header(subject.encode('utf-8'), 'utf-8')
    60         con['Subject']=sub
    60         con['Subject']=sub
       
    61         self.subject = subject
       
    62         self.body = body
    61         self.frm=frm
    63         self.frm=frm
    62         Message.__init__(self, con, typ='mail')
    64         Message.__init__(self, con, typ='mail')
    63 
    65 
    64     def as_string(self):
    66     def as_string(self):
    65         return self.content.as_string()
    67         return self.content.as_string()
    71         if self.as_string() != other.as_string():
    73         if self.as_string() != other.as_string():
    72             return False
    74             return False
    73 
    75 
    74         if self.frm != other.frm:
    76         if self.frm != other.frm:
    75             return False
    77             return False
       
    78         
       
    79         return True
    76 
    80 
    77         return True
    81     def __repr__(self):
       
    82         return "<Mail(%s,%s,%s)>"%(self.subject,self.body,self.frm)