Using vi, I created a file in /home/tmp/mailmessages with the body of what I want to write. For this example it is /home/tmp/mailmessages/myFileTellingEveryone
Then I created the following bash script, name mymailer and put in the /bin or /sbin directory:
#!/bin/bash
IFS=":-;"
#FILE= "/home/tmp/mailmessages/$3"
#echo $(basename "$2")
mail -s $(basename "$2") $(basename "$1") < /home/tmp/mailmessages/$(basename "$3")
Do a chmod so that you can execute it (chmod 777 works for me) and now all I do is type:
#mymailer me@me.com "This is my Subject" myFileTellingEveryone
I just keep changing the email address and I can send out this way.
No comments:
Post a Comment