'Emit a record.
Format the record and send it to the specified addressees.
It would be really nice if I could add authorization to this class
without having to resort to cut and paste inheritance but, no.'

def emit(self, record):

    try:
        port = self.mailport
        if (not port):
            port = smtplib.SMTP_PORT
        smtp = smtplib.SMTP(self.mailhost, port)
        smtp.login(self.username, self.password)
        msg = self.format(record)
        msg = ('From:    %s\r\nTo:    %s\r\nSubject:    %s\r\nDate:    %s\r\n\r\n%s' % (self.fromaddr, ','.join(self.toaddrs), self.getSubject(record), email.utils.formatdate(), msg))
        smtp.sendmail(self.fromaddr, self.toaddrs, msg)
        smtp.quit()
    except (KeyboardInterrupt, SystemExit):
        raise
    except:
        self.handleError(record)
