mercurial/ui.py
changeset 2583 6e5427447f4c
parent 2502 18cf95ad3666
child 2584 1f4703115e28
equal deleted inserted replaced
2576:6a961a54f953 2583:6e5427447f4c
   296         call as sendmail(sender, list-of-recipients, msg).'''
   296         call as sendmail(sender, list-of-recipients, msg).'''
   297 
   297 
   298         def smtp():
   298         def smtp():
   299             '''send mail using smtp.'''
   299             '''send mail using smtp.'''
   300 
   300 
   301             s = smtplib.SMTP()
   301             local_hostname = self.config('smtp', 'local_hostname')
       
   302             s = smtplib.SMTP(local_hostname=local_hostname)
   302             mailhost = self.config('smtp', 'host')
   303             mailhost = self.config('smtp', 'host')
   303             if not mailhost:
   304             if not mailhost:
   304                 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
   305                 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
   305             mailport = int(self.config('smtp', 'port', 25))
   306             mailport = int(self.config('smtp', 'port', 25))
   306             self.note(_('sending mail: smtp host %s, port %s\n') %
   307             self.note(_('sending mail: smtp host %s, port %s\n') %