Sending mail to group


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending mail to group
# 1  
Old 12-08-2010
Sending mail to group

Hi,

How can i send a mail to a group in Linux? for example, I want to send a notification mail to 20 people and I want to create a group of these 20 people and want to send them the notification

pls help me in this.
# 2  
Old 12-08-2010
You can setup a group mail alias. Try "man aliases" for details.
This User Gave Thanks to citaylor For This Post:
# 3  
Old 12-08-2010
Thanks for quick reply. But, can you please explain how can I implement the aliases in the following script?
+++++++++++++++++++++++++++++++++++++
#!/bin/bash
ps aux|grep DPROPR > /dev/null
if [ $? -ne 0 ]; #if not running
then
mail -s "DPROPR is not running" email ids
fi
+++++++++++++++++++++++++++++++++++++

I want to send the mail to a group if the script doesn't find DPROPR process runnning.
# 4  
Old 12-08-2010
On the "mail" statement instead of sending the email to "user1" "user2", etc, you can create an alias group1 which contains the list of users, and then simply send the email to "group1"
# 5  
Old 12-08-2010
You mean, in /etc/aliases file I can add the line such as:

group1: abc@xyz.com, bcd@xyz.com,etc

and include the following command in the script:

sendmail "hello" group1

will this work?

Thanks in advance for your reply.
# 6  
Old 12-08-2010
Yes - the group entry is correct. And there is then two common ways of sending the mail, either by using "mail":
Code:
mail -s "subject" group1 < email_file

Or by calling sendmail (slightly different because you have to create the envelope headers), for example:
The Answer Gang 65: sendmail
This User Gave Thanks to citaylor For This Post:
# 7  
Old 12-08-2010
Thanks for reply..

I am having another issue, when I am trying to send a mail to my own email from the Linux machine (I am running this machine as a virtual machine using vmware), I am not receiving any mails.

but, when I am trying to send a mail through another linux machine, I am receiving the mails.

So, can you pls let me know, how can this issue be resolved?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending email to group in bash

In shell scripting, TestEmail is an existing group email. I am using the below command to send emails who are existed under TestEmail . Unable to receive the email. I have tried group ="id1 id2 " .Its working and i tried creating alias as well. Can we do it without creating alias or group ="id1... (1 Reply)
Discussion started by: thomas9192
1 Replies

2. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

3. UNIX for Dummies Questions & Answers

Sending mail

How can i send a mail when user login in unix ENV. How can i know present use mailID?? Moved out of Contact Us Forum - Please Do Not Post Technical Questions in Non-Technical Forum(s) (1 Reply)
Discussion started by: arun508.gatike
1 Replies

4. Shell Programming and Scripting

Stop sending mail after certain number of mail

Hi guys... I am busy writing a script to notify me via an mail if my application is down. I have done that. Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application. When the application is up again that count should be... (5 Replies)
Discussion started by: Phuti
5 Replies

5. UNIX for Advanced & Expert Users

problem in sending mail to a group

I am calling a unix script in oracle to send a mail to outlook group using mailx. The cmd looks like this: mailx -s "AA_BBB_" APPostServices@xyz.com APPostServices@xyz.com isa group but the mail is not sent but when i send mail to another group it works fine. What are the things that i... (1 Reply)
Discussion started by: petervuksich
1 Replies

6. Shell Programming and Scripting

problem in sending mail to a group

I am calling a unix script in oracle to send a mail to outlook group using mailx. The cmd looks like this: mailx -s "AA_BBB_" APPostServices@xyz.com APPostServices@xyz.com isa group but the mail is not sent but when i send mail to another group it works fine. What are the things that i... (1 Reply)
Discussion started by: petervuksich
1 Replies

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

8. HP-UX

hp ux not sending mail

Hi.. In Hp ux box,, mails are not being sent. they are getting queued up in mail queue. (3 Replies)
Discussion started by: kkhan
3 Replies

9. Shell Programming and Scripting

Mail sending

Dear all, how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent. the version i use is Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux Thanks Regards, Pankaj (15 Replies)
Discussion started by: panknil
15 Replies

10. UNIX for Dummies Questions & Answers

sending a mail to a mail client

Hi everyone! I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string. Is there a way to send this message to a mail client using SMTP? Even better, is there any place on this site that has these kinds of... (5 Replies)
Discussion started by: solaris73
5 Replies
Login or Register to Ask a Question