2 Blog Entries tagged: email
Testing Emails with Django
Django ticket #8638 titled, "Provide setting to disable e-mail sending", caught my eye as an interesting item to look into. As I looked into it, however, I came up with a pretty simple way to set up testing that involves some settings.py changes and about 4 lines of Python code.
The big piece of magic comes from Python's built-in smtpd library and the smtpd.DebuggingServer class, which discards all e-mails sent to it and prints them to stdout.
Let's use the class to create a local mail server that will discard and print all emails sent to ...
Using Gmail's SMTP server from Django
Ever since changeset 5144 Django has had the ability to send email directly through Gmail with a few extra settings in your settings.py file. I recently set up a server using Ubuntu and had no intention of receiving email on it, but I did, however, want my website to be able to send email, so this is a great solution for that case.
Gmail
Consider creating a new email account from which the email will be sent. I like to do this for a few reasons:
- For security reasons I don't want to list my password of my ...