This is a fork from shenjia/raspbian-ip-mailer
This version can:
- Try several times to connect smtp server, because the Wifi may be not ready yet.
- Print progress infomation while connect, login and sending mail.
- Install as a service automatically.
-
Download deploy.sh and run it.
wget https://github.com/lowstz/server-ip-mailer/raw/master/deploy.sh sudo chmod +x deploy.sh ./deploy.sh
-
Update your mail account in
/usr/local/bin/server-ip-mailer.py
:# Mail account settings mail_setting = { 'mail_user': '[email protected]', 'mail_password': 'password' } send_to_list = [ '[email protected]', '[email protected]' ]
If you don't use gmail, update those also:
# smtp server settings smtp_setting = { 'smtp_server': 'smtp.gmail.com', 'smtp_port': 587 }
-
Reboot and enjoy it!