This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author matrixise
Recipients eamanu, lidayan, matrixise, vinay.sajip
Date 2019-02-14.12:26:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550147184.8.0.689462905309.issue35995@roundup.psfhosted.org>
In-reply-to
Content
Here is my suggestion

class SMTPSSLHander(SMTPHandler):
    def emit(self, record):
        """
        Emit a record.

        Format the record and send it to the specified addressees.
        """
        try:
            import smtplib
            from email.message import EmailMessage
            import email.utils

            port = self.mailport
            if not port:
                port = smtplib.SMTP_SSL_PORT
            keyfile = self.secure[0] if len(self.secure) > 0 else None
            certfile = self.secure[1] if len(self.secure) > 1 else None
            smtp = smtplib.SMTP_SSL(self.mailhost, port, timeout=self.timeout,
                                    keyfile=keyfile, certfile=certfile)
            if self.username:
                smtp.login(self.username, self.password)
            msg = EmailMessage()
            msg['From'] = self.fromaddr
            msg['To'] = ','.join(self.toaddrs)
            msg['Subject'] = self.getSubject(record)
            msg['Date'] = email.utils.localtime()
            msg.set_content(self.format(record))
            smtp.send_message(msg)
            smtp.quit()
        except Exception:
            self.handleError(record)
History
Date User Action Args
2019-02-14 12:26:24matrixisesetrecipients: + matrixise, vinay.sajip, eamanu, lidayan
2019-02-14 12:26:24matrixisesetmessageid: <1550147184.8.0.689462905309.issue35995@roundup.psfhosted.org>
2019-02-14 12:26:24matrixiselinkissue35995 messages
2019-02-14 12:26:24matrixisecreate