6

I am trying to send an email from a work PC that is behind a proxy.

In settings.py my code looks like this:

    #email setup
    EMAIL_USE_TLS = True
    EMAIL_HOST = 'smtp.gmail.com'
    EMAIL_HOST_USER = 'username@gmail.com'
    EMAIL_HOST_PASSWORD = 'password'
    EMAIL_PORT = 587

In views.py:

    from django.core.mail import send_mail

    def home(request):
        context = RequestContext(request)
        send_mail('test email', 'hello world', 'sender@gmail.com', ['receiver@email.com'], fail_silently=False)
        return render_to_response('project/home.html', context)

This gives the error:

    [Errno 10061] No connection could be made because the target machine actively refused it

How can I implement authentication with the proxy?

Jamneck
  • 443
  • 8
  • 14

0 Answers0