Django does it automatically for testing, https://docs.djangoproject.com/en/dev/topics/testing/overview/#email-services