~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Adeodato Simó
  • Date: 2007-06-19 16:11:26 UTC
  • mto: (2547.1.1 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 2548.
  • Revision ID: dato@net.com.org.es-20070619161126-zwni0l40maepwyj5
New SMTPConnection class, a reduced version of that in bzr-email.

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
 
3580
3580
                self.outf.writelines(directive.to_lines())
3581
3581
        else:
3582
3582
            message = directive.to_email(mail_to, branch, sign)
3583
 
            s = smtplib.SMTP()
3584
 
            server = branch.get_config().get_user_option('smtp_server')
3585
 
            if not server:
3586
 
                server = 'localhost'
3587
 
            s.connect(server)
3588
 
            s.sendmail(message['From'], message['To'], message.as_string())
 
3583
            s = SMTPConnection(branch.get_config())
 
3584
            s.send_email(message)
3589
3585
 
3590
3586
 
3591
3587
class cmd_tag(Command):