~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-25 13:46:10 UTC
  • mfrom: (2547.1.1 Aaron's integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070625134610-4y70duw4fcuj8txe
Add SMTPConnection class (Adeodato Simó)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
lazy_import(globals(), """
24
24
import codecs
25
25
import errno
26
 
import smtplib
27
26
import sys
28
27
import tempfile
29
28
import time
56
55
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
57
56
from bzrlib.conflicts import ConflictList
58
57
from bzrlib.revisionspec import RevisionSpec
 
58
from bzrlib.smtp_connection import SMTPConnection
59
59
from bzrlib.workingtree import WorkingTree
60
60
""")
61
61
 
3584
3584
                self.outf.writelines(directive.to_lines())
3585
3585
        else:
3586
3586
            message = directive.to_email(mail_to, branch, sign)
3587
 
            s = smtplib.SMTP()
3588
 
            server = branch.get_config().get_user_option('smtp_server')
3589
 
            if not server:
3590
 
                server = 'localhost'
3591
 
            s.connect(server)
3592
 
            s.sendmail(message['From'], message['To'], message.as_string())
 
3587
            s = SMTPConnection(branch.get_config())
 
3588
            s.send_email(message)
3593
3589
 
3594
3590
 
3595
3591
class cmd_tag(Command):