/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-06-25 13:17:32 UTC
  • mfrom: (2535.2.5 bzr.smtp_connection)
  • mto: This revision was merged to the branch mainline in revision 2548.
  • Revision ID: abentley@panoramicfeedback.com-20070625131732-8jp7229jrt5r7khp
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):