Solved:

I commented out:

smtplib_SSL

#        try:
#            # First try end-to-end encryption
#            syslog.syslog(syslog.LOG_DEBUG, "lowBattery: try using 
SMTP_SSL: %s, %s, %s" % (self.smtp_host, seld.smtp_port, self.smtp_timeout))
#            s=smtplib.SMTP_SSL(self.smtp_host, self.smtp_port, None, 
self.smtp_timeout)
#            syslog.syslog(syslog.LOG_DEBUG, "lowBattery: using SMTP_SSL")
#        except AttributeError:
            # If that doesn't work, try creating an insecure host, then 
upgrading
        syslog.syslog(syslog.LOG_DEBUG, "lowBattery: try creating an 
insecure host, then upgrading")
        s = smtplib.SMTP(self.smtp_host, self.smtp_port, None, self.
smtp_timeout)
        try:
            # Be prepared to catch an exception if the server
            # does not support encrypted transport.
            syslog.syslog(syslog.LOG_DEBUG, "lowBattery: try encrypted 
transport")
            s.ehlo()
            s.starttls()
            s.ehlo()
            syslog.syslog(syslog.LOG_DEBUG,
                          "lowBattery: using SMTP encrypted transport")
        except smtplib.SMTPException:
            syslog.syslog(syslog.LOG_DEBUG, "lowBattery: unencrypted 
transport")
            syslog.syslog(syslog.LOG_DEBUG,
                          "lowBattery: using SMTP unencrypted transport")

Now it works:

Dec  5 21:53:38 weewxPi weewx[4636]: lowBattery: try creating an insecure 
host, then upgrading
Dec  5 21:53:38 weewxPi weewx[4636]: lowBattery: try encrypted transport
Dec  5 21:53:38 weewxPi weewx[4636]: lowBattery: using SMTP encrypted 
transport
Dec  5 21:53:38 weewxPi weewx[4636]: lowBattery: logged in as notify@example
.com
Dec  5 21:53:39 weewxPi weewx[4636]: lowBattery: email sent to: [
'[email protected]']

and I received the mail.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9ce62311-ec0b-4b96-91c4-5f3ab118041d%40googlegroups.com.

Reply via email to