2014-04-18, 18:28
Hello all,
I thought that i would share a little script that i made that will allow you to send emails from XBMC using python.
It's only a small script but it works perfectly for me!
Here is the python script that will send the emails :
And here is how you set your email address that you will send it from :
And your password :
When sending an email you can input the email address by using :
For the email's subject you can use
And as for the actual message you can just use :
Feel free to change anything around and integrate this in to any of your plugins/skins or whatever
I thought that i would share a little script that i made that will allow you to send emails from XBMC using python.
It's only a small script but it works perfectly for me!
Here is the python script that will send the emails :
PHP Code:
import smtplib
to = xbmc.getInfoLabel( '$INFO[Skin.string(EmailTo)]' )
gmail_user = xbmc.getInfoLabel( '$INFO[Skin.string(MyEmail)]' )
gmail_pwd = xbmc.getInfoLabel( '$INFO[Skin.string(MyPassword)]' )
msg = xbmc.getInfoLabel( '$INFO[Skin.string(MyMessage)]' )
sub = xbmc.getInfoLabel( '$INFO[Skin.string(MySubject)]' )
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject:' + sub + '\n'
print header
msg = header + '\n' + msg + '\n\n'
smtpserver.sendmail(gmail_user, to, msg)
print 'done!'
smtpserver.close()
And here is how you set your email address that you will send it from :
PHP Code:
Skin.SetString(MyEmail)
And your password :
PHP Code:
Skin.SetString(MyPassword)
When sending an email you can input the email address by using :
PHP Code:
Skin.SetString(EmailTo)
For the email's subject you can use
PHP Code:
Skin.SetString(MySubject)
And as for the actual message you can just use :
PHP Code:
Skin.SetString(MyMessage)
Feel free to change anything around and integrate this in to any of your plugins/skins or whatever