scheduler Script

Hi,

My requirement is i want to send mails from server to all my employess with one attachment file for every monday and friday like scheduler.. how it is possible through bash script. please guide me..

With Regards
Anish Kumar.V

Using mailx and uuencode :

 (uuencode FILENAME ATTACHNAME) | mailx -ms "Subject" mail@mail

You can also use mutt.

Use cron to setup the day (notice weekday) for script execution.

crontab manual :

minute hour monthday month weekday command
weekday The day of the week, 0-6, 0=Sunday

Hi Peasant,

Mail is not a prob but...i need to send same attachment to N number of mail ids for example

if i have 3 mail ids means

07anis@gamil.com
anish@gamil.com
kumar@gmail.com

at the same time i need to send mail from server to this 3 mail ids.

i think using script we can do that..

like we need to assign all the mail ids store into one file form that we need to get input..that code only i am searching how to do that process...if you have any idea means please share..

With Regards
Anish Kumar.V

you can add the mail ids in one command:

mailx -ms "Subject" 07anis@gamil.com, anish@gamil.com, kumar@gmail.com

hi rdcways,

for 3 mail id means this command okay but i need to send nearly 200 mail -ids then...how ?

set a group mailbox and add 200 ids in it.

If you are unable to do so, as rdcwayx suggested, feel free to use FOR I IN or WHILE READ LINE formulations with some kind of plaintext file with emails in.

Also something like this should work (not tested)

mailx -ms "Subject" $(cat emails.txt)

Hi peasant,

It Works fine i can able to send multiple email address..but now issue is..

This is my /etc/alliases configuration...in that i configure whenever i send mail form root The receivers want to receive from the mail id 07anis@gmail.com but it not works...is there any mistake iam doing?? Please Guide me to resolve this issue..

With Regards
Anish Kumar.V

If you are using MUTT, you will find all the information online (cannot post links still don't have 5 posts :rolleyes:), it's about creating .muttrc in HOME folder and configuring it a bit.

With mailx check out the -r option.