equal
deleted
inserted
replaced
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'): |