Install software:

opkg update
opkg install python-openssl
nano /mnt/sda1/gmail.py
#!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
USERNAME = "xxxxxx@gmail.com"
PASSWORD = "xxxxxx"
MAILTO  = "you@yourmail.com"
msg = MIMEText('Hello,\nMy name is Yun, \nhow are you')
msg['Subject'] = 'Mail from Yun'
msg['From'] = USERNAME
msg['To'] = MAILTO
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo_or_helo_if_needed()
server.starttls()
server.ehlo_or_helo_if_needed()
server.login(USERNAME,PASSWORD)
server.sendmail(USERNAME, MAILTO, msg.as_string())
server.quit()
chmod 755 /mnt/sda1/gmail.py
/mnt/sda1/gmail.py

Comments (0)

    Attach images by dragging & dropping or by selecting them.
    The maximum file size for uploads is MB. Only files are allowed.
     
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    The maximum number of 3 allowed files to upload has been reached. If you want to upload more files you have to delete one of the existing uploaded files first.
    Posting as

    Comments powered by CComment