send email to more users


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers send email to more users
# 1  
Old 03-21-2006
send email to more users

Hi,

If I want to send an email to serveral users, what is the correct way to do it?

I know a little bit mail command. If I want to send email to John and Scott after UNIX shell scripts have completed the job. I type:

mail -s 'Job has been completed successfully' john@yahoo.com < log.txt

I also want the same email go to Scott. What to do? Type another mail command or add Scott@hotmail.com after John's email address?

Please help.
# 2  
Old 03-21-2006
Just enclose the list of email addresses in quotes. Where it's a message to one person and copied to other(s) then you can use the -c "list" instead.

cheers
# 3  
Old 03-21-2006
thestevew:

Thanks. Where do I put this list of email address? Should I type:

mail -s 'xxxxxxxx' "email1, email2, email3" -c "list" < log.txt

Please be specific.
# 4  
Old 03-21-2006
space seperated entries and not comma seperated entries,
Code:
mailx -s "<subject>" "<addr1> <addr2>" < log.txt

Smilie please search the forum Smilie
# 5  
Old 03-21-2006
matrixmadhan:

Thanks for your advice. I have tried with your syntax. It didn't work. My original syntax is like this:

mail -s ' xx data loading is successful.' email@yahoo.com < loading.log exit 1

Could you show your syntax here? Thanks a lot.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send email from shell to users in Mysql

Hi, I need help about sending mail in linux. I have a ubuntu server with working web site, users are uploading files in one main directory (to folder inbox). With samba I shared that directory and on other mashine is Windows server and application that is reading that files and writting content to... (3 Replies)
Discussion started by: drazenmd
3 Replies

2. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

3. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

4. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

5. UNIX for Dummies Questions & Answers

to send email to multiple users

hi, i'm pretty new to this unix. i've been asked to create a shell script which will pick up the email id from a text file(stored in same machine, same directory) searches for that id in another file in which a product name( a one line text) is mentioned against it. then it should send a mail... (0 Replies)
Discussion started by: vishwas.shenoy
0 Replies

6. Shell Programming and Scripting

Using mailx to send email to multiple users.

Hi, I am using the mailx command to send email to multple users. The command works fine when i am sending mail to a single user but when i insert multiple email ids inside the quote it does not work. All the email ids are coming from a property file.Please have a lookt at the property file and... (4 Replies)
Discussion started by: priyaksingh
4 Replies

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

8. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question