Using third party Email system for Django Password Reset
<p>I have a Django App hosted on Google Compute Engine(which doesn't allow port 25/465/587 to send Emails). So, I integrated a third party Email system in the Django App. Third party Email system works find on Google Compute Engine too. </p>

<p>But when I use Django Reset Password, that email is still getting sent over by the Django Default Email System. Can this Django Default Email system for password Reset be changed ?</p>

<p>If yes, Can someone please explain how it can be changed ? </p>

<p>Thanks,</p>

<p>There is something like <a href="https://docs.djangoproject.com/el/1.10/topics/email/#email-backends" rel="nofollow">Email backends</a></p>

<pre><code># settings.py
EMAIL_BACKEND = 'project.backends.mail.CustomEmailBackend'

# project/backends/mail.py
from django.core.mail.backends.base import BaseEmailBackend
class CustomEmailBackend(BaseEmailBackend):
    def send_messages(self, messages):
        for message in messages:
            # do the stuff with each message
            print(message.subject, message.body, message.to, message.cc)
</code></pre>

<p>Remeber that path dotted in <code>EMAIL_BACKEND</code> variable in <code>settings.py</code> must be the same as location of your <code>CustomEmailBackend</code> class in your project folder tree.</p>

<p>Each <code>message</code> has the same <a href="https://docs.djangoproject.com/el/1.10/topics/email/#emailmessage-objects" rel="nofollow">properties</a>.
Of course <code>send_mail</code> from <code>django.core.mail</code> will work as usuall, but use your <code>CustomEmailBackend</code> for sending emails.</p>

python django email passwords google-compute-engine