A Simple script to send myself an email
#1
Brick 
Hello Community.Confused

I am trying to send my self an email but getting script faliure... here is the code

Code:
import smtplib
import xbmc
import xbmcgui

content = 'this is where i will type my name with the on-screen keyboard...eventually'
mailserver = smtplib.SMTP("smtp.some_mail.com",465)
mailserver.ehlo()
mailserver.starttls()
mailserver.login('[email protected]','thepassword')
mailserver.sendmail('[email protected]','[email protected]',content)
mailserver.close()

here is the error log

Code:
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'module' object has no attribute 'SMTP'
                                            Traceback (most recent call last):
                                              File "C:\Users\User\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.super.favourites\Super Favourites\Maintenance\email_snippet\email.py", line 1, in <module>
                                                import smtplib
                                              File "C:\Program Files (x86)\Kodi\system\python\Lib\smtplib.py", line 46, in <module>
                                                import email.utils
                                              File "C:\Users\User\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.super.favourites\Super Favourites\Maintenance\email_snippet\email.py", line 6, in <module>
                                                mailserver = smtplib.SMTP("smtp.live.com",465)
                                            AttributeError: 'module' object has no attribute 'SMTP'
                                            -->End of Python script error report<--

Can anyone please help...I think it could be that Kodi does not use the 'import smtplib' but 'import email.utils' or something like that

Thanks a million.
Reply
#2
google the error and you'll find the answer:
http://stackoverflow.com/questions/16512...-in-python
http://stackoverflow.com/questions/24821...hon-script
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thank you ronie, perfect. changed email.py to something else and it works. I also had a problem with the port got error code 10060 changed the port to 25 and it works. Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
A Simple script to send myself an email0