Twisted is an great asynchronous networking library for Python. I was looking for an example of using it to send mail locally, but most examples assume you have access to an SMTP server that you can send through. After some trial and error, I figured out a method that seems to work based on connecting directly to each recipient’s mail host.
The following is an example that does not assume that you have access to an SMTP server. It first resolves the DNS MX record for the recipient’s domain and then attempts to connect to it to send the message:
You could use this code to send a crap ton of emails all asynchronously. Fun stuff.