Sending mails to various users without hard coding the email IDS


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending mails to various users without hard coding the email IDS
# 8  
Old 06-02-2008
Only the content matters and should be that of a simple textfile, not the filename. In Unix/Linux such endings like *.txt only matters for humans reading such names when listing contents of a directory. The system will tell you soon, if the content isn't in the right format.

Best get a list of differences from Windows to *nix!

BTW: When working with Unix/Linux, case matters. ADDRESSES and adresses is not the same! Best read some basic introduction to Unix/Linux because it can help a lot to avoid errors before they happen. I tend to write variable names completely in uppercase.
# 9  
Old 06-02-2008
Actually if the list isn't very large (hundreds of kilobytes, on many modern platforms) you can just

Code:
(echo "here is the data!" | uuencode datafile datafile) | mail -s "mysubject" `cat addressfile`

If you get "command line too long" errors, then you need to split up the list somehow. Looping over the list one by one is not very elegant, as your mail transport agent can optimize delivery if there are several recipients in the same domain; but it can only do that if you send to them all in one go. (Anyway, if the list is very large and/or very dynamic, you should perhaps look into using a real Mailing List Manager application. GNU mailman seems to be the current popular choice.)
# 10  
Old 06-03-2008
Hi

Thanks for you valuable inputs

Its working...........



Manas
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email IDs added to .mailrc aliases not receiving mails

hi, I added an email id to a list of existing aliases in .mailrc on my unix box, using vi editor. However, the new id has not been receiving any mails from the box. Kindly help as to what needs to be done here. Does the box need to be rebooted for these changes to reflect? Is there any other... (5 Replies)
Discussion started by: qwerty000
5 Replies

2. Solaris

Sending Mails to the Multiple Email Address

Hi All, I am pretty new to the mail service in Sun Solaris 5.10. If anybody help me in writing a script for the multiple recipient with subject and the body would be a helpful. Kindly help... Thanks in advance. :) Warm Regards, Pramod (5 Replies)
Discussion started by: Pramod_009
5 Replies

3. Shell Programming and Scripting

How to send mails based on email ids residing in table?

Hello Gurus, I have one table which consists of two field:- PROG_NAME EMAIL xxxx email1,email2,email3 yyyy email4,email1,email2 I want to to send mails by using mailx command. But how do I get each and every mail ids from table against... (4 Replies)
Discussion started by: pokhraj_d
4 Replies

4. Web Development

Using LWP without hard coding password

Hi, I would like to read content from a https site. I have decided to use LWP module in perl. but it throwed 401 Authorization required error. i dont want to hard code the password in my perl code. Is there any way to achieve the authentication without hardcoding the password. Thanks,... (1 Reply)
Discussion started by: pandeesh
1 Replies

5. HP-UX

Sending email to multiple IDs

Hi, I am trying to send an email to multiple IDs from Unix script. I have given the EmailIds in a file and trying to use the file as input in the script. > cat Email EmailID = "abc@xyz.com cbz@xyz.com" In my script I have . /Email mailx -s "subj" $EmailID This fails with the... (3 Replies)
Discussion started by: sangharsh
3 Replies

6. Programming

char constants vs. hard-coding

This might be a silly question, but I thought I'd ask anyway. If I'm writing in C, isn't it more efficient to, for instance, use constant character variable set to 'A' instead of hard-coding a character 'A'? Since it's only a single character instead of a string, it might not matter much. (10 Replies)
Discussion started by: cleopard
10 Replies

7. Shell Programming and Scripting

Sending an email to group of users

Hi , I want to write a Unix script which can send an automatic email to the group when my job is completed.I'm trying the following Mail -s "test" <groupname> << EOD >Completed >EOD With this i'm not able to send an email to group..Any ideas? Thanks in Advance (1 Reply)
Discussion started by: BhawanaAggarwal
1 Replies

8. Shell Programming and Scripting

I wanted to update a script, more dynamic (just say no to hard coding)...

currently it has the following: bdumpN=`ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | grep "$Cdate" | wc -l` If I pass the DBname, I would not have to hardcode it in the script... I can capture the database name by adding the following: DBname=$1 The problem is, I have been unable... (2 Replies)
Discussion started by: mr_manny
2 Replies

9. UNIX for Dummies Questions & Answers

Sending Mass mails

Hi Forum, I am extremely new to unix.Can somebody please help me out with the following: I am supposed to write a script that will ftp a file which is a .csv and conatins the following: Mail-id Path of file abc@xyz.com D:\xyz\abc.htm ash@sde.com ... (1 Reply)
Discussion started by: iyerdeepa82
1 Replies
Login or Register to Ask a Question