Email sent to multiple user address?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Email sent to multiple user address?
# 8  
Old 10-13-2010
You don't mention the O/S but most "mailx" versions will need one invocation per recipient.

Code:
for email in "allan@gmail.com" "bruce8899@gmail.com" "Chris@gmail.com"
do
    echo "$dir : $filecount is over the limit $limit " | mailx -s "${SUBJECT}" "${email}"
done


There are more complicated methods of processing a list of recipients by using mailx tilde commands but it still needs one invocation of "mailx" per recipient.
# 9  
Old 10-13-2010
I think using a comma between the email addresses will do the work.
# 10  
Old 10-13-2010
Hi
I still cannot sent out the email to multiple user . This is my man mailx
Code:
 Send mode:
      mailx [-FUm] [-s subject] [-r address] [-h number] address ...

    Receive mode:
      mailx -e

      mailx [-UHLiNn] [-u user]

      mailx -f [-UHLiNn] [filename]

    Obsolescent:
      mailx [-f filename] [-UHLiNn]

while how to set it sent to multiple user ?
# 11  
Old 10-13-2010
Ahh the man helps, so your mailx does support multiple address. Just use:

Code:
emails="allan@gmail.com bruce8899@gmail.com Chris@gmail.com"

echo "$dir : $filecount is over the limit $limit " | mailx -s "${SUBJECT}" ${emails}

Notice no quotes around the ${emails} this will expand each email to a seperate parameter (as the "..." in the usage show your mailx requires).
# 12  
Old 10-13-2010
I try liao....it only sent the email to 1 user only...
# 13  
Old 10-13-2010
Quote:
Originally Posted by proghack
I try liao....it only sent the email to 1 user only...
Do you have the quotes around the assignment?

Your original post shows:
Code:
Email = allan@gmail.com bruce8899@gmail.com Chris@gmail.com

But have you tried:
Code:
email="allan@gmail.com bruce8899@gmail.com Chris@gmail.com"


Last edited by Chubler_XL; 10-13-2010 at 11:30 PM.. Reason: formatting
# 14  
Old 10-13-2010
Yup , i try both method....also same..only sent to 1user....any nothing error come out.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

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

2. Forum Support Area for Unregistered Users & Account Problems

Cant use certain email address

I tried to re-register using my new email address which is <firstname>@<surname>.me But it never sent out the email confirmation. I had to hit the back button and use my gmail address instead and it came through instantly. Is there a problem with using .me addresses? (1 Reply)
Discussion started by: frustin
1 Replies

3. Forum Support Area for Unregistered Users & Account Problems

Change email address

How can I change email address registered with my unix.com account (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

4. HP-UX

How to change the email from address?

Hi Friends, I am facing one issue with my hpux server. I used to send mail from the hpux server directly to the customer id. By default the from address includes the complete hostname(eg:- user1@hostname.domain.com). My domain name is registered, but this individual hostname is not... (1 Reply)
Discussion started by: arumon
1 Replies

5. UNIX for Dummies Questions & Answers

Panic kernal-mode address fault on user address 0x14

:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message: PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14 KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD) EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies

6. Shell Programming and Scripting

Finding an email address

Hi all, I have a file with X number of lines. Somewhere within each line will be an email address following the format: <telephone_number>@domain.net Each line is not a set length and there are no delimiters to work with. I want to write a script that extracts the telephone number... (3 Replies)
Discussion started by: mandriver
3 Replies

7. UNIX for Dummies Questions & Answers

redirection to email address

Can someone please tell me the format to redirect an output file to an email address? thanks (4 Replies)
Discussion started by: 4Given
4 Replies

8. UNIX for Dummies Questions & Answers

Send email where # is in the email address - Using Unix

Hi All, How do I send an email using malix where email address contains a #. I have a email address like this : #test@test.com I want to send email like malix -s "TEST" #test@test.com < SOMEFILE I tried \# but doesn't work. Please let me know how we can achieve this? I am in... (1 Reply)
Discussion started by: jingi1234
1 Replies

9. Post Here to Contact Site Administrators and Moderators

i have removed my email address

I have removed my email address from the posted email. what else do I need to do? Thanks K-one (1 Reply)
Discussion started by: K-ONE
1 Replies
Login or Register to Ask a Question