mail.py
branchstable
changeset 5579 297b2002a083
parent 5424 8ecbcbff9777
child 5590 a56eb02f9ce7
child 5733 d00d1fab42af
equal deleted inserted replaced
5577:4e3ca117c275 5579:297b2002a083
    83     name
    83     name
    84     """
    84     """
    85     assert type(content) is unicode, repr(content)
    85     assert type(content) is unicode, repr(content)
    86     msg = MIMEText(content.encode('UTF-8'), 'plain', 'UTF-8')
    86     msg = MIMEText(content.encode('UTF-8'), 'plain', 'UTF-8')
    87     # safety: keep only the first newline
    87     # safety: keep only the first newline
    88     subject = subject.splitlines()[0]
    88     try:
    89     msg['Subject'] = header(subject)
    89         subject = subject.splitlines()[0]
       
    90         msg['Subject'] = header(subject)
       
    91     except IndexError:
       
    92         pass # no subject
    90     if uinfo.get('email'):
    93     if uinfo.get('email'):
    91         email = uinfo['email']
    94         email = uinfo['email']
    92     elif config and config['sender-addr']:
    95     elif config and config['sender-addr']:
    93         email = unicode(config['sender-addr'])
    96         email = unicode(config['sender-addr'])
    94     else:
    97     else: