title: Django file based email backend
body: <p>It's probably something very obvious, but I can't seem to figure it out.</p>
  <p>This snippet is from Django's file based email backend (django.core.mail.backends.filebased.py)</p>
  <pre><code>    def write_message(self, message):
          self.stream.write(message.message().as_bytes() + b&quot;\n&quot;)
  </code></pre>
  <p>My question is. How can I find out what class is <strong>message</strong> an object of?</p>
  <p><strong>Context for why:</strong>
  My code sends emails along various execution paths. I want to leverage Django's filebased backend, instead of firing live emails during debugging and unit testing (<em>or creating my own file based system</em>). The relevant code has a MIMEMultipart object currently (<em>with utf-8 coded text</em>) that works fine for production. I need to be able to convert that into an object that can be printed legibly by the above snippet.</p>
  <p>PS: I come from a C++ background where this would've been an easy question to answer.</p>