Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate_email ERROR - On Test Email Send #41

Open
MikeBrWade opened this issue Jul 6, 2017 · 11 comments

Comments

@MikeBrWade
Copy link

commented Jul 6, 2017

I have attempted to get this plug in setup, but even once I installed keyring and yagmail I get:
"sending failed. Reason :: send() got an unexpected keyword argument "validate_email".

This makes it seem like by default octoprint doesn't come with the pip package validate_email installed, but I went ahead and installed it as well and still get that error.

EDIT: btw if I do a test send just from the python console using yagmail.SMTP().send() it works fine.

@jeffgolden

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2017

Take a look at my pull request -- it appears that yagmail was recently changed and removed the validate_email parameter from the send method. The plugin is trying to reference that parameter in the send method, but it no longer exists. If you remove that parameter (it was set to False anyway) you can get the plugin to work.

@MikeBrWade

This comment has been minimized.

Copy link
Author

commented Jul 6, 2017

@jeffgolden : Great response time, and yep that fixed the issue. Don't you love it when APIs change and mess up your code base! Thanks alot for the quick fix, and hopefully your pull is approved soon to keep others from dealing with this.

NOTE: I will leave the issue open until the pull is accepted (or is closed by the repo owner)

@DrWatson

This comment has been minimized.

Copy link

commented Jul 17, 2017

Just to be clear, I modified the file __ init __.py found in /home/pi/oprint/lib/python2.7/site-packages/octoprint_emailnotifier and changed the line:

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

to

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

Just in case someone else is looking for more direct instructions. You have to restart Octoprint for the changes to take affect.

@ItsMrChops

This comment has been minimized.

Copy link

commented Aug 21, 2017

@DrWatson Thanks for your post, got me up and running!

@hammiesam

This comment has been minimized.

Copy link

commented Aug 22, 2017

@ItsMrChops Hey there, I can't for the life of me locate the init.py file in /home/pi/oprint/lib/python2.7/site-packages/octoprint_emailnotifier

what did you type in while connected via ssh to get to that file?

i'm also getting the "Sending failed. Reason:: send() got an unexpected keyword argument 'validate_email' " error.

Thanks!

@ItsMrChops

This comment has been minimized.

Copy link

commented Aug 22, 2017

I'm a Windows user and know next to nothing about Linux but found I could use Notepad++ and it's NppFTP plugin to connect with SFTP. It has a directory browser and editing files is really easy. I think the .py file name starts with _ maybe. Hope this helps.

@hammiesam

This comment has been minimized.

Copy link

commented Aug 22, 2017

@ItsMrChops oh wow, somehow i never thought to sftp into my pi to see the directory browser, I've been doing everything in the terminal the entire time! I've connected through sftp and made the change! I just need to wait for the print to finish up before I restart octoprint. Thank you for the tremendous tip!

@ManuGithubSteam

This comment has been minimized.

Copy link

commented Sep 4, 2017

This is the path for me:

~/OctoPrint/venv/lib/python2.7/site-packages/octoprint_emailnotifier

@thauch

This comment has been minimized.

Copy link

commented Sep 8, 2017

This was the location for me:
~/oprint/lib/python2.7/site-packages/octoprint_emailnotifier

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

Now I am getting this message:
Sending failed. Reason:: Emailaddress "" is not valid according to RFC 2822 standards

Any ideas?
Thanks

Update
I tried sending an email through python and it worked but I had to import yagmail again.
Then I tried again in OctoPrint and was successful. Do I have to import yagmail on every restart?

@DrWatson

This comment has been minimized.

Copy link

commented Sep 8, 2017

I had the " is not valid according to RFC 2822 standards" error when I was using it too. All I needed to do was save the settings and reopen the configuration for notifier and hit test again and it worked. I think it's just not picking up the live value from the control so saving it and reloading the configuration fixes it.

@Stady234

This comment has been minimized.

Copy link

commented Jun 18, 2018

Is this still an open issue? I was able to get it to work under 0.15.1 with only adding one more line to the yagmail setup...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.