title: Python, Django: catch SMTPRecipientsRefused. Get "undefined variable" instead
body: <p>I get the following exception when I try to send an email:</p>
  
  <pre><code>Traceback (most recent call last):
    my_own_functions ...
    File "C:\Python27\lib\site-packages\django\core\mail\message.py", line 248, in send
      return self.get_connection(fail_silently).send_messages([self])
    File "C:\Python27\lib\site-packages\django\core\mail\backends\smtp.py", line 92, in send_messages
      sent = self._send(message)
    File "C:\Python27\lib\site-packages\django\core\mail\backends\smtp.py", line 110, in _send
      email_message.message().as_string())
    File "C:\Python27\lib\smtplib.py", line 733, in sendmail
      raise SMTPRecipientsRefused(senderrs)
  SMTPRecipientsRefused: {'aaa': (553, "5.1.2 We weren't able to find the recipient domain. Please check for any\n5.1.2 spelling errors, and make sure you didn't enter any spaces, periods,\n5.1.2 or other punctuation after the recipient's email address. q10sm6381464wie.2")}
  </code></pre>
  
  <p>I want to catch that exception and have tried:</p>
  
  <pre><code>try:
      sendActivationEmail()
  except SMTPRecipientsRefused:
      return "error"
  </code></pre>
  
  <p>However, that gives me an "undefined variable" error. It's not recognizing SMTPRecipientsRefused. In Eclipse it says "Undefined variable: SMTPRecipientsRefused"</p>