~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smtp_connection.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-16 16:40:10 UTC
  • mto: This revision was merged to the branch mainline in revision 6391.
  • Revision ID: jelmer@samba.org-20111216164010-z3hy00xrnclnkf7a
Update tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    )
34
34
 
35
35
 
 
36
smtp_password = config.Option('smtp_password', default=None,
 
37
        help='''\
 
38
Password to use for authentication to SMTP server.
 
39
''')
 
40
smtp_server = config.Option('smtp_server', default=None,
 
41
        help='''\
 
42
Hostname of the SMTP server to use for sending email.
 
43
''')
 
44
smtp_username = config.Option('smtp_username', default=None,
 
45
        help='''\
 
46
Username to use for authentication to SMTP server.
 
47
''')
 
48
 
 
49
 
36
50
class SMTPConnection(object):
37
51
    """Connect to an SMTP server and send an email.
38
52
 
48
62
        if self._smtp_factory is None:
49
63
            self._smtp_factory = smtplib.SMTP
50
64
        self._config = config
51
 
        self._config_smtp_server = config.get_user_option('smtp_server')
 
65
        self._config_smtp_server = config.get('smtp_server')
52
66
        self._smtp_server = self._config_smtp_server
53
67
        if self._smtp_server is None:
54
68
            self._smtp_server = self._default_smtp_server
55
69
 
56
 
        self._smtp_username = config.get_user_option('smtp_username')
57
 
        self._smtp_password = config.get_user_option('smtp_password')
 
70
        self._smtp_username = config.get('smtp_username')
 
71
        self._smtp_password = config.get('smtp_password')
58
72
 
59
73
        self._connection = None
60
74