Sending email asynchronously

This fixes #2. Essentially it keeps the connection active for the
duration of the database transaction and whatever IO needs to be
performed, instead of for the whole interaction with the mail
server.