Mail to a file of users


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mail to a file of users
# 1  
Old 05-30-2011
Mail to a file of users

How can I send the same form email to multiple users, but with variances like their username, password, and login host or environment? At work we use vdi's which are extremely slow - especially opening Outlook to open a form letter saved on Sharepoint. I was wondering if I could put the users' email addresses in a txt file and send a form email but with variables that would change for each user like $USER, $PASSWORD, $HOSTNAME.

I've been playing with the "mail" command and have been able to send test emails to myself so I'd like to just keep a text file of users who have been provisioned with access and then send out the form correspendence at the end of the day. I don't know if this is really an efficient means - I've heard of something called a "mail merge" which I believe you can do through Outlook - but just thought I'd see what your ideas would be. The email contains all the same login procedures but I can't just bcc each user because the hostnames and passwords are specific for each user (in separate emails of course). Thanks.
# 2  
Old 05-30-2011
guess the username is same as mailbox ID.

for example, you have your csv file (list.csv) ready as following format:

Code:
username, password, login host, environment

run below code:
Code:
while read line
do
   username=`echo $line |cut -d, -f1`
   echo $line |mailx -s " your accont - $username" $username@YOUR_ORG.com
done < list.csv

# 3  
Old 06-11-2011
Hey thanks a lot for your reply. I was thinking of just going with a mail merge in Outlook because we send email with all that information, but apparently my boss claims he can do all this and also include the html formatting. So we'll see how that goes - I had to submit a proposal to implement all this - and if my boss if full of it then I'll try your method.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Simple loop to mail all active users.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Send a fortune to all active/logged in users 2. Relevant commands, code, scripts, algorithms: So I understand... (8 Replies)
Discussion started by: kjcraig77
8 Replies

2. Shell Programming and Scripting

Send a mail to multiple users

I have a file 1.txt which has 3 mail ids as below: Maillist=abc@gmail.com def@gmail.com rcg@gmail.com Now I want to write a script which will read this file and send the mail to all the users present in this file. (6 Replies)
Discussion started by: Vivekit82
6 Replies

3. Shell Programming and Scripting

Move and later delete mail data of nonexistant users.

Hello everyone! i hope u can help me... i need a script that is able to do: When a user gets deleted in the ldap DB, the mail folder remains. How can i move to another location and delete it after a month? :wall: (2 Replies)
Discussion started by: newbreaker12
2 Replies

4. Homework & Coursework Questions

script to mail users on comand line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script to send a customized mail message to the users listed on the command line by login (user)... (3 Replies)
Discussion started by: alis
3 Replies

5. Shell Programming and Scripting

How to get users history as mail..

Hi all, Thanks in Advance, i want to view my users commands, what commands they are using in their terminal like that, how to automate this history process daily. (6 Replies)
Discussion started by: anishkumarv
6 Replies

6. Shell Programming and Scripting

Send e-mail to users

Dear all, The perl script to send e-mail is working in my current script. #This part of the script will send the email notification my $to='mohamed.rahman@noridian.com'; my $from='xyz@hotmail.com'; my $subject='POS_CODES_38 DATA LOADED SUCCESSFULLY.'; my $message='The total no. of files... (2 Replies)
Discussion started by: msrahman
2 Replies

7. Ubuntu

script for memory monitoring and sending mail to users in network

I m working on a script which monitors the disk usage and send a mail to the users if it reaches a limit of 90%. hlp me (2 Replies)
Discussion started by: navdeep5673
2 Replies

8. UNIX for Dummies Questions & Answers

in var/spool/mail, same entry with different users....

i am on aix, in the /var/spool/mail ,i have an entry as below, after doing a ls -ltr -rw-rw---- 1 ai mail 3898 Sep 02 11:26 mei -rw-rw---- 1 root mail 22900 Nov 08 14:55 root shouldnt the ai and mei be the same just like root, root? thanks (2 Replies)
Discussion started by: yls177
2 Replies

9. UNIX for Dummies Questions & Answers

How to send mail to multiple users ???

Hi All, How to send mails to multiple users using a single mailx command. Urgently require help Thanks in advance Rgds Arunava (3 Replies)
Discussion started by: arunava_maity
3 Replies
Login or Register to Ask a Question