Quote:
Originally Posted by twantrd
This is what I would do:
Code:
#!/bin/bash
echo "enter subject"
read sub
echo "enter message"
read mess
echo "mail to"
read letter
echo "please enter day of month to send mail"
read day
echo "0 23 $day * * cat \"$mess\" | mail -s \"$sub\" $letter" > /tmp/cron.mail
crontab /tmp/cron.mail
And here are the results:
twantrd@twantrd:~$ /tmp/test
enter subject
Hi there
enter message
How are you?
mail to
me@mydomain.com
please enter day of month to send mail
15
twantrd@twantrd:~$ crontab -l
0 23 15 * * cat "How are you?" | mail -s "Hi there" me@mydomain.com
So, this is just one script that does all the work for you and it's pretty simple once you look at it. This will set the cronjob for that user to mail out that message at 11:00pm on the 15th of every month.
-twantrd
|
Both are not working ?....
Should I setup something for the pop and other stuffs ..??
should I use a .forward ?
Thank you very much !!
Patrick