On Jan 17, 7:46 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote: > > If you need to use smtp authentication there is a small problem > with `SMTPHandler`. Actually, you need to subclass `SMTPHandler` > and override `emit` method, e.g.: > > fromloggingimport getLogger, Formatter, DEBUG > fromlogging.handlers import SMTPHandler > > class SMTPAuthHandler(SMTPHandler): > def __init__(self, mailhost, fromaddr, toaddrs, subject, > user=None, password=None): > SMTPHandler.__init__(self, mailhost, fromaddr, toaddrs, subject) > self.user = user > self.password= password > [snip]
Although the code in the last release does not support authentication (hence needing the above code), the code currently in SVN does support it. Instead of separate user and password arguments, a new "credentials" optional argument ((user, password) tuple, defaulting to None) has been added. So if you are using Rob Wolfe's approach, it may be easier for you to use "credentials" because your code will not need to change when Python 2.6 appears. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list