Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (14 sloc) 0.646 kB
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from gmail import GmailProxy, MessageSendingFailure
class GmailBackend(BaseEmailBackend):
def __init__(self, fail_silently=False, *args, **kwargs):
self.gmail_proxy = GmailProxy(settings.SECRET_KEY, settings.EMAIL_APPENGINE_PROXY_URL, fail_silently)
super(GmailBackend, self).__init__(fail_silently, *args, **kwargs)
def send_messages(self, messages):
n = 0
for message in messages:
sent = self.gmail_proxy.send_mail(message.message())
if sent:
n += 1
return n
Jump to Line
Something went wrong with that request. Please try again.