adding multiple email ID


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting adding multiple email ID
# 1  
Old 01-30-2010
adding multiple email ID

Hi,
I have a script running as a cron job. Is it possible to send the output to multiple user through mail. I cant add multiple mail id.

Code:
_TOADDR=xxx@xxx.com;xxx@xxx.com
_FROMADDR=xxx@xxx.com

from=$_FROMADDR
emailtarget=$_TOADDR
subject=$_SUBJECT
CONTENT=$1

Is it possible to send to multiple mail id.

Thanks,
Ahamed

Last edited by pludi; 01-30-2010 at 05:40 PM.. Reason: code tags, please....
# 2  
Old 01-30-2010
For mailx (and I imagine sendmail) use a comma "," instead of a semi-colon ";" as the separator between email addresses, e.g.:
Code:
mailx -s "mail to multiple users" tom@doman.com,dick@domain1.com,harry@domain2.com < message.txt

So in your case:
Code:
_TOADDR="xxx@xxx.com,xxx@xxx.com"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a blank line in between two O/Ps in tabular format which gets received over email

Hi Guys, I am stuck in between and seeking help here. Requirement: A script that will run every morning which will connect to Mysql database and run the query to inform us about the holidays (it will also check if there were any holidays during last 2 business days). So the three queries are... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

2. Shell Programming and Scripting

Adding 'from' email address alias in Linux.

Hi Experts, We want to add the 'from' email address to mailx command in all our linux script. After searching this site I am able to find the command '-- -f' to add the from the email address. Bu the problem is our from email address is :- "Proper Support Name <support@company.com>" Now when I... (6 Replies)
Discussion started by: Amey Joshi
6 Replies

3. UNIX for Dummies Questions & Answers

Sendmail with cat adding extra spaces in email body

when I try to read a file and send email using cat and sendmail: The email received having additional spaces.(Between the letters of words in the text) My code: export MAILTO="sa@y.com" export SUBJECT="mydomain PREPROD MONITOR AT ${DATE}" export... (5 Replies)
Discussion started by: visitsany
5 Replies

4. Shell Programming and Scripting

Adding the email functionality

I have make an menu in which first option is to start and second is to stop the services echo "Please enter the appropriate choice for doing the operations" echo " 1) STOP Services 2) START Services case $choice in 1) ... (4 Replies)
Discussion started by: punpun66
4 Replies

5. Red Hat

Adding multiple iptables_MODULES

I have a RHEL 5.8 server and I am trying to implement a writable FTP server. I need to add the following module as below, IPTABLES_MODULES=”nf_conntrack_ftp nf_nat_ftp” But there is already a module like this, IPTABLES_MODULES=”ip_conntrack_netbios_ns” My query is how to add 2... (1 Reply)
Discussion started by: RHCE
1 Replies

6. Shell Programming and Scripting

[Solved] adding email option to KSH

Hi, I wanted to add a email option to this script. and was wondering if anyone could help me out. #!/bin/ksh echo "Finding hdisk" <DIR>/find-disk i=1 b=0 p=0 while ... (2 Replies)
Discussion started by: vpundit
2 Replies

7. Shell Programming and Scripting

Adding Multiple Files via Columns

I have a number of files with multiple rows that I need to add together. Let say I have 10 files: Each file has a great number of rows and columns. I need to add these files together the following way. In other words, If, for example, file A occupies Columns 1 to 19, I want to add file B... (7 Replies)
Discussion started by: Ernst
7 Replies

8. Shell Programming and Scripting

bash adding multiple names

Hi all, I make this bash script in which there is one option to add a name in txt file. So when I run the script it ask me for the name. When i enter the name, that name gets added in a txt file. If i add the same name again, the message comes up, the name is already there My question is..... (2 Replies)
Discussion started by: Learnerabc
2 Replies

9. Shell Programming and Scripting

adding single word to multiple line.

I have following problem. <File A> contains let say 5 lines but can be changed. cat dog fish car if I want to add word to each line then how do I go about it? I used paste -d but that requires two files having same number of lines but in my case <File A> changes and I just need to... (6 Replies)
Discussion started by: paulds
6 Replies

10. Shell Programming and Scripting

Adding Multiple Lines to Multiple Files

Hello, I have three lines I need to add to hundreds of files. The files are all in the same format and contain the same information. I want to add the same information to the files. The new lines of information are similar. Here is an example of the three lines: line1: line2 =... (2 Replies)
Discussion started by: dayinthelife
2 Replies
Login or Register to Ask a Question