~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/email_message.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-05 21:15:13 UTC
  • mfrom: (5448.3.5 374700-Add-gnu-lsh-support)
  • Revision ID: pqm@pqm.ubuntu.com-20101005211513-whouyj5t7oo92gmq
(gz) Add support for GNU lsh as a secure shell client (Matthew Gordon)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""A convenience class around email.Message and email.MIMEMultipart."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from email import (
22
20
    Header,
23
21
    Message,
149
147
 
150
148
    @staticmethod
151
149
    def send(config, from_address, to_address, subject, body, attachment=None,
152
 
             attachment_filename=None, attachment_mime_subtype='plain'):
 
150
            attachment_filename=None, attachment_mime_subtype='plain'):
153
151
        """Create an email message and send it with SMTPConnection.
154
152
 
155
153
        :param config: config object to pass to SMTPConnection constructor.
183
181
    def string_with_encoding(string_):
184
182
        """Return a str object together with an encoding.
185
183
 
186
 
        :param string\\_: A str or unicode object.
 
184
        :param string_: A str or unicode object.
187
185
        :return: A tuple (str, encoding), where encoding is one of 'ascii',
188
186
            'utf-8', or '8-bit', in that preferred order.
189
187
        """