anoved / OctoPrint-EmailNotifier

Receive email notifications when OctoPrint jobs are complete. Currently broken. Please fork and fix!
GNU Affero General Public License v3.0
16 stars 35 forks source link

Cannot get to work with gmail #39

Closed spot1984 closed 7 years ago

spot1984 commented 7 years ago

I have it configured exactly as I have on another Octopi installation but when I click "Send a test email" I just get this error:

Sending failed. Reason:: send() got an unexpected keyword argument 'validate_email'

I can send emails just fine from yagmail in python like this: >>> import yagmail >>> s=yagmail.SMTP('mymail@gmail.com') >>>s.send('destination@someplace.com','subject','body')

It uses the same gmail account as the other printer so there is no problem with credentials, or alerts from google or anything.

I tried all kinds of stuff - credentials with and without the gmail.com, uninstalled and reinstalled, yagmail, keyrings.alt, many reboots. Uninstalled and reinstalled it on the older working Octopi installation and it still works.

Could the latest yagmail validations may not like the mail format (?) I can install an older version, is there one guaranteed to work?

I'm running Octopi on a pi zero w. I had to do a full package and rpi upgrade to get wifi to work on the pi so it is running on the latest and greatest everything.

Halp!

spot1984 commented 7 years ago

I just created new installation on a fresh SD card from the latest Octopi image 2016-03-18-octopi-jessie-lite-0.13.0.img ...

Then I configured Octoprint

Sending failed. Reason:: send() got an unexpected keyword argument 'validate_email'

(-_-)

Note that this does not involve the Raspberry Pi Zero W nor did I do anything except what was necessary to use Email Notifier.

jeffgolden commented 7 years ago

it appears that validate_email is not (no longer? -- i'm not sure) a valid argument to the send method of yagmail.SMTP. I managed to get it working by changing:

mailer.send(to=emails, subject=subject, contents=body, validate_email=False) to mailer.send(to=emails, subject=subject, contents=body)

~/oprint/lib/python2.7/site-packages/octoprint_emailnotifier/__init__.py

Hope this helps.

spot1984 commented 7 years ago

Jeff,

That worked perfectly! Thank you for the quick response and for the excellent plug in!

:-D

~ Scott

jeffgolden commented 7 years ago

Glad I could help -- but I should clear up. I'm just a user of the plug-in like you. I just ran into the same issue and fixed it by doing this. But I share my thanks to the author, @anoved.

spot1984 commented 7 years ago

ROFL! Thanks Jeff.

I was so thrilled to get it working after wasting half a holiday weekend on it I didn't pay attention when I replied.