The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to send email to multiple users vishwas.shenoy UNIX for Dummies Questions & Answers 0 01-25-2008 03:00 AM
How to send an email? aajan UNIX for Dummies Questions & Answers 1 06-12-2007 01:53 AM
Using mailx to send email to multiple users. priyaksingh Shell Programming and Scripting 4 02-20-2006 10:37 PM
Send email where # is in the email address - Using Unix jingi1234 UNIX for Dummies Questions & Answers 1 05-23-2005 08:23 AM
Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win) Vetrivela UNIX for Advanced & Expert Users 2 02-15-2005 07:43 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-20-2006
Registered User
 

Join Date: Nov 2005
Posts: 127
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.
Reply With Quote
Forum Sponsor
  #2  
Old 03-21-2006
Registered User
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
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
Reply With Quote
  #3  
Old 03-21-2006
Registered User
 

Join Date: Nov 2005
Posts: 127
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.
Reply With Quote
  #4  
Old 03-21-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
space seperated entries and not comma seperated entries,
Code:
mailx -s "<subject>" "<addr1> <addr2>" < log.txt
please search the forum
Reply With Quote
  #5  
Old 03-21-2006
Registered User
 

Join Date: Nov 2005
Posts: 127
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0