Debugging SMTP communication in Django

After a while getting trouble with the sending email functionality of my Django app, I read the core of Django and python's smtplib module to find a way to debug the smtp connection. I only need to set the debug level = True when we create the connection in the email backend of Django (or in whatever email backend you're using):



def open(self):


     self.connection.set_debuglevel = True



When I send the email from my Django app, the console will give me some useful information

Read more about the Django core email backend:

and the smtplib module:


It saved my day! \m/\m/\m/