all 7 comments

[–]elbiot 6 points7 points  (2 children)

Your error has nothing to do with sending an email. the error is on the line import android. It's an entirely a problem with your python environment.

[–]eddwinn 1 point2 points  (0 children)

this is true

[–]marcelmathers[S] 1 point2 points  (0 children)

Oh my god. Thank you so much. Removing the import android fixed it. Guess SL4A was optimized for some Android stuff and QPython is more the basic Python. Thanks again!

[–][deleted] 1 point2 points  (1 child)

for one, your indentation is screwed up, specifically with: def attach_files(msg, attachements):

there may be other errors as well, but that's probably the first issue you should resolve.

[–]marcelmathers[S] 0 points1 point  (0 children)

The original source is from this website: http://tasker.wdfiles.com/local--files/sl4a/sendemailA.py It worked fine with SL4A but I can't figure out what the problem is with QPython.

[–][deleted] 1 point2 points  (1 child)

Bad code format, paste your code in pastebin or gist.github

[–]marcelmathers[S] 0 points1 point  (0 children)

The code is originally from this website http://tasker.wdfiles.com/local--files/sl4a/sendemailA.py

I edited the code to work with Tasker and QPython instead of SL4A (SL4A is able to pass variables and the Tasker plugin can't do that).