mercurial/mail.py
branchstable
changeset 12090 ee601a6264e0
parent 11542 594b98846ce1
child 12091 339bd18c772f
equal deleted inserted replaced
12083:ebfc46929f3e 12090:ee601a6264e0
    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 = int(ui.config('smtp', 'port', 25))
    40     mailport = int(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'):