def emit(self, record):
    '\n        Emit a record.\n\n        Format the record and send it to the specified addressees.\n        '
    try:
        import smtplib
        from email.utils import formatdate
        port = self.mailport
        if (not port):
            port = smtplib.SMTP_PORT
        smtp = smtplib.SMTP(self.mailhost, port)
        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), formatdate(), msg))
        if self.username:
            if (self.secure is not None):
                smtp.ehlo()
                smtp.starttls(*self.secure)
                smtp.ehlo()
            smtp.login(self.username, self.password)
        smtp.sendmail(self.fromaddr, self.toaddrs, msg)
        smtp.close()
    except (KeyboardInterrupt, SystemExit):
        raise
    except:
        self.handleError(record)
Emit a record.

Format the record and send it to the specified addressees.
def emit(self, record):
    '\n        Emit a record.\n\n        Format the record and send it to the specified addressees.\n        '
    try:
        import smtplib
        from email.utils import formatdate
        port = self.mailport
        if (not port):
            port = smtplib.SMTP_PORT
        smtp = smtplib.SMTP(self.mailhost, port)
        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), formatdate(), msg))
        if self.username:
            if (self.secure is not None):
                smtp.ehlo()
                smtp.starttls(*self.secure)
                smtp.ehlo()
            smtp.login(self.username, self.password)
        smtp.sendmail(self.fromaddr, self.toaddrs, msg)
        smtp.close()
    except (KeyboardInterrupt, SystemExit):
        raise
    except:
        self.handleError(record)