Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sending mails to various users without hard coding the email IDS Post 302201438 by era on Monday 2nd of June 2008 08:34:37 AM
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.)
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
help(1) 						      General Commands Manual							   help(1)

NAME
help - Provides information for new users SYNOPSIS
help DESCRIPTION
The help command presents a one-page display of information for new users. Information is available for the following topics: Concatenat- ing or displaying files Editing lines interactively Sending and receiving mail Reading system messages Changing password file information Identifying current users of the system Sending messages to the other users on the system Displaying the contents of directories Viewing information on the Source Code Control System Setting terminal modes SEE ALSO
Commands: cat(1), ex(1), finger(1), ls(1), mail(1), mailx(1), passwd(1), sccshelp(1), tset(1), who(1), write(1) help(1)
All times are GMT -4. The time now is 05:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy