mercurial/ui.py
changeset 2286 9f745d3675d4
parent 2281 7761597b5da3
child 2292 903ab41ac7eb
equal deleted inserted replaced
2285:0912f807b7ff 2286:9f745d3675d4
   269 
   269 
   270         return t
   270         return t
   271 
   271 
   272     def sendmail(self):
   272     def sendmail(self):
   273         s = smtplib.SMTP()
   273         s = smtplib.SMTP()
   274         s.connect(host = self.config('smtp', 'host', 'mail'),
   274         mailhost = self.config('smtp', 'host')
   275                   port = int(self.config('smtp', 'port', 25)))
   275         if not mailhost:
       
   276             raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
       
   277         s.connect(host=mailhost, port=int(self.config('smtp', 'port', 25)))
   276         if self.configbool('smtp', 'tls'):
   278         if self.configbool('smtp', 'tls'):
   277             s.ehlo()
   279             s.ehlo()
   278             s.starttls()
   280             s.starttls()
   279             s.ehlo()
   281             s.ehlo()
   280         username = self.config('smtp', 'username')
   282         username = self.config('smtp', 'username')