shell script to send separate mails to different users from a text file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users shell script to send separate mails to different users from a text file
# 1  
Old 05-30-2011
shell script to send separate mails to different users from a text file

Hi Friends,

Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file.
text file contains the no. of records like:

Code:
giridhar
224285
847333
giridhar276@gmail.com
ramana
84849
33884
venkata.ramana@gmail.com
kishore
838393
484949
kishore.pulapa@gmail.com
venkat
434334
343433
venkateswararao@gmail.com
Every four lines make one record. For example consider the first record. I need to send a mail to giridhar276@gmail.com containing the his details "giridhar,224285,847333".
Now the details in the second record(next four lines) has to be sent to venkata.ramana@gmail.com

Like wise I need to send an email to other users alsooo......

Moderator's Comments:
Mod Comment Double post, continued here, thread closed

Last edited by pludi; 05-30-2011 at 10:59 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to compare text and send a mail

Hello, Somebody can help me to develop a script for the below requirement I have a 3 files in a directory which was dynamically changed everyday basis. I need a script to fetch the 1pattern of strings in each file. if the three matching pattern is same send a mail with subject as success else... (1 Reply)
Discussion started by: MATHANKUMAR
1 Replies

2. Shell Programming and Scripting

Creating new users using a text file as imput (using only shell script and/or awk)

I need somebody who could help with an exercise. You have a text file called users.txt with this info inside: users.txt: user1:1234:/home/homedir1 ; user2:1234:/home/homedir2 ; user3:1234:/home/homedir3 ; user4:1234:/home/homedir4 ; The script should create an user using the... (2 Replies)
Discussion started by: marcosruiz
2 Replies

3. Shell Programming and Scripting

Create users from a text file by script

Hi All, I am new to scripting, i want to create one script in which i can add users from a text file, assign them a default password like 123456. It should be like: Username= $i (it should take users from text file one by one) Password : 123456(default for every user) (1 Reply)
Discussion started by: prad_rocxx
1 Replies

4. Shell Programming and Scripting

Script for count files and send mails

Hi. I'm new on this forum and I need if possible someone to help me with one script. The script should act like this: - should be run by crontab and have next parameters: script_name $par1 $par2 $par3 $par4 where script will search in dir $par1 for files with mask $par2 and if number of... (2 Replies)
Discussion started by: atrailm
2 Replies

5. Shell Programming and Scripting

Calling DB user from separate file in Shell script

Hi All, I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want... (3 Replies)
Discussion started by: sathish.tn
3 Replies

6. UNIX for Dummies Questions & Answers

need assistance on Calling DB user from separate file in Shell script

Hi All, I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want... (1 Reply)
Discussion started by: sathish.tn
1 Replies

7. Shell Programming and Scripting

script to separate bilingual text file

Hi all I have a bilingual text file, one language is English and another one is Assamese. I want to write English language text into one file and Assamese language text into another file. For Example- input file is as dsad জন gdfkghdfkghkdf hksdjhfkjsdfhk hksjdhfksdjf আনজনৰ মনত ghgj jkj... (11 Replies)
Discussion started by: wildhorse
11 Replies

8. Shell Programming and Scripting

Read a file with in UNIX and send multiple mails

Hi-I want to create a shell script which should read a file line by line (file having email address and transaction id of each user)and send email on email ids with the transaction id of the user respectively. Please help - I think a while loop should help but I am very new too UNIX Shell... (1 Reply)
Discussion started by: DeepSalwan
1 Replies

9. UNIX for Dummies Questions & Answers

Parse Text file and send mails

Please help. I have a text file which looks something like this aaa@abc.com, c:FilePath\Eaaa.txt bbb@abc.com, c:FilePath\Ebbb.txt ccc@abc.com, c:FilePath\Eccc.txt ddd@abc.com, c:FilePath\Eddd.txt...so on I want to write a shell script which will pick up the first field 'aaa@abc.com' and... (12 Replies)
Discussion started by: Amruta Pitkar
12 Replies

10. Solaris

how to send mails to users on exchange server from sendmail/solaris(mailx)

Hi, Can anyone pls. tell me how to access Active directory from solaris. I am looking at solution by which I can send mail notification from the logs generated by scripts, to the users on Exchange server. I am trying for a Perl-LDAP module , but don't realy know how to go for it (5 Replies)
Discussion started by: ganeshh
5 Replies
Login or Register to Ask a Question