equal
deleted
inserted
replaced
65 return _smtp(ui) |
65 return _smtp(ui) |
66 |
66 |
67 return _sendmail(ui, method) |
67 return _sendmail(ui, method) |
68 |
68 |
69 def sendmail(ui, sender, recipients, msg): |
69 def sendmail(ui, sender, recipients, msg): |
70 return connect(ui).sendmail(sender, recipients, msg) |
70 try: |
|
71 return connect(ui).sendmail(sender, recipients, msg) |
|
72 except smtplib.SMTPRecipientsRefused, inst: |
|
73 recipients = [r[1] for r in inst.recipients.values()] |
|
74 raise util.Abort('\n' + '\n'.join(recipients)) |
|
75 except smtplib.SMTPException, inst: |
|
76 raise util.Abort(inst) |
71 |
77 |
72 def validateconfig(ui): |
78 def validateconfig(ui): |
73 '''determine if we have enough config data to try sending email.''' |
79 '''determine if we have enough config data to try sending email.''' |
74 method = ui.config('email', 'method', 'smtp') |
80 method = ui.config('email', 'method', 'smtp') |
75 if method == 'smtp': |
81 if method == 'smtp': |