Here is a script which can be used to send a common mail to all number of receipients, with all the recepient mail ids stored in a text file.
The script uses the tool gnome-gmail, which can be installed from your package repository, In debian based systems it can be installed using
Create a file called mialIds which will have a a list of mail ids to which mails need to be sent. For example
Create a file with the following script and name it as mailscript.sh
The input variable in the script should point to the file containing the mail ids.. If the script and the file containing mail ids are in the same folder, then just the name is enough.
The variable subj is used to store the content to be filled in the subject line of the mail. The variable bod will contain the text for the body of the email.
Execute the script
If you execute it the first time, gnome-gmail will prompt you to enter the gmail id that needs to be use dfor sending the email. If the gmail is in the logged in state in the browser, it will be able to send the mail automatically, else it might open the login prompt for you to login into the gmail account.
Gnome-gmail Its a great way to automate sending default emails.
No comments:
Post a Comment