Log errors that occur when sending emails

We don't want to stop the entire sending process when there's an error,
but we also don't want to fail silently.  Instead of using the
``send_messages`` method, handle opening and closing the connection
ourselves and log an error message if there's an error, but otherwise
squash the exception.

Addresses #580