User Tools

Site Tools


bash_scripts_to_check_gmail

Table of Contents

Scripts To Check Email

Gmail

As of January 2018, for this to work, you need to turn on the option to “allow less secure apps to access your account” in your Google account settings.

As an example, these scripts assume you have a gmail address of “johndoe@gmail.com” with a password of “mypassword”. Modify them to whatever you need.

Show subject of each unread Gmail message:

<html> <script src=“https://gist.github.com/jfcarr/61880bd75ae550601c5c32f41d38d57b.js”></script> </html>

Show unread Gmail message count:

<html> <script src=“https://gist.github.com/jfcarr/c68e3b2677cdcd74b484f2524f7a3bdb.js”></script> </html>

IMAP

Uses “your.mailserver.com” as an example mail server, and “john.doe@mailserver.com” with a password of “password” as a sample email account. Change it to whatever you need.

Also, you can make as many calls to MyMail.CheckUnread() as you want, checking multiple email accounts.

<html> <script src=“https://gist.github.com/jfcarr/07dfc5717f157816da99aacabaed7eb2.js”></script> </html>

bash_scripts_to_check_gmail.txt · Last modified: 2018/12/31 18:38 by 127.0.0.1