title: Django mail sending error:[ Error 10061]
body: <p>I followed The Django Book to Chapter 7. When I was trying the example of contact, I met this mail sending error.</p>
  
  <p>Does anyone know how to fix this?</p>
  
  <p>Here is the error information:</p>
  
  <p>error at /contact/<br>
  [Errno 10061] <br>
  Request Method: POST<br></p>
  
  <pre><code>Request URL:    http://127.0.0.1:8000/contact/&lt;br&gt;
  </code></pre>
  
  <p>Django Version: 1.5<br>
  Exception Type: error<br>
  Exception Value:[Errno 10061] <br>
  Exception Location: C:\Python27\lib\socket.py in create_connection, line 571<br>
  Python Executable:  C:\Python27\python.exe<br>
  Python Version: 2.7.2<br>
  Python Path: <br>
  ['D:\Workspace\DJhello',<br>
   'D:\Workspace\DJhello',<br>
   'D:\Workspace\DJhello\src',<br>
   'C:\Python27\DLLs',<br>
   'C:\Python27\lib',<br>
   'C:\Python27\lib\plat-win',<br>
   'C:\Python27\lib\lib-tk',<br>
   'C:\Python27',<br>
   'C:\Python27\lib\site-packages',<br>
   'C:\Python27\lib\site-packages\win32',<br>
   'C:\Python27\lib\site-packages\win32\lib',<br>
   'C:\Python27\lib\site-packages\Pythonwin',<br>
   'C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg-info',<br>
   'C:\Windows\system32\python27.zip']<br>
  Server time:    Thu, 14 Mar 2013 12:08:14 +0800<code>enter code here</code><br></p>
  
  <p>Here is my code:</p>
  
  <pre><code>def contact(request):
      errors = []
      if request.method == 'POST':
          if not request.POST.get('subject', ''):
              errors.append('Enter a subject.')
          if not request.POST.get('message', ''):
              errors.append('Enter a message.')
          if request.POST.get('email') and '@' not in request.POST['email']:
              errors.append('Enter a valid e-mail address.')
          if not errors:
              send_mail(
                  request.POST['subject'],
                  request.POST['message'],
                  request.POST.get('email', 'noreply@example.com'),
                  ['siteowner@example.com'],
              )
              return HttpResponseRedirect('/contact/thanks/')
      return render_to_response('contact_form.html',
          {'errors': errors, 
          'subject': request.POST.get('subject', ''),
          'message': request.POST.get('message', ''), 
          'email': request.POST.get('email', '')}, 
          context_instance=RequestContext(request))
  </code></pre>