title: python + django+ EmailMultiAlternatives Template' object has no attribute 'encode
body: <p>I am sending an email by following method:</p>
  
  <pre><code>EmailMultiAlternatives() 
  </code></pre>
  
  <p>When the send() method is called; I get error in somewhere base class. </p>
  
  <pre><code>lib/email/encoders.py
  'Template' object has no attribute 'encode'
  </code></pre>
  
  <blockquote>
    <p>Exception Location:   C:\Python27\lib\email\encoders.py in encode_7or8bit, line 73 </p>
    
    <p>Python Executable:    C:\Python27\python.exe</p>
  </blockquote>
  
  <p>error path:</p>
  
  <pre><code>&gt;   return msg.send(fail_silently)
  
  C:\Python27\lib\email\mime\text.py in __init__
  &gt;  self.set_payload(_text, _charset)
  
  C:\Python27\lib\email\message.py in set_payload
  &gt;   self.set_charset(charset)
  
  C:\Python27\lib\email\message.py in set_charset
  &gt;  cte(self)
  
  C:\Python27\lib\email\encoders.py in encode_7or8bit
  &gt;  orig.encode('ascii')
  </code></pre>
  
  <p>can anyone have an idea about this error?</p>
  
  <p><strong>Update</strong>
  using the following code helped me solve my problem. </p>
  
  <pre><code>fail_silently=True
  
  t = get_template(template_name)
  html_part = t.render(context)
  msg = EmailMultiAlternatives(subject,
                                   t,
                                   sender,
                                   recipients,
                                   bcc=bcc)
  msg.attach_alternative(html_part, "text/html")
  
  return msg.send(fail_silently)
  </code></pre>