Refactors some of the send email code, only connect to server once, then send all of the emails with that one session.