mercurial/mail.py
changeset 12091 339bd18c772f
parent 12076 49463314c24f
parent 12090 ee601a6264e0
child 13201 f05250572467
equal deleted inserted replaced
12089:70f4a0f4e9a3 12091:339bd18c772f
    34     '''build an smtp connection and return a function to send mail'''
    34     '''build an smtp connection and return a function to send mail'''
    35     local_hostname = ui.config('smtp', 'local_hostname')
    35     local_hostname = ui.config('smtp', 'local_hostname')
    36     s = smtplib.SMTP(local_hostname=local_hostname)
    36     s = smtplib.SMTP(local_hostname=local_hostname)
    37     mailhost = ui.config('smtp', 'host')
    37     mailhost = ui.config('smtp', 'host')
    38     if not mailhost:
    38     if not mailhost:
    39         raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
    39         raise util.Abort(_('smtp.host not configured - cannot send mail'))
    40     mailport = util.getport(ui.config('smtp', 'port', 25))
    40     mailport = util.getport(ui.config('smtp', 'port', 25))
    41     ui.note(_('sending mail: smtp host %s, port %s\n') %
    41     ui.note(_('sending mail: smtp host %s, port %s\n') %
    42             (mailhost, mailport))
    42             (mailhost, mailport))
    43     s.connect(host=mailhost, port=mailport)
    43     s.connect(host=mailhost, port=mailport)
    44     if ui.configbool('smtp', 'tls'):
    44     if ui.configbool('smtp', 'tls'):