Sending email to group in bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending email to group in bash
# 1  
Old 09-28-2017
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 id2 " .

echo -e "This is Test Mail" | mail -s "ALERT: TEST MAIL" TestEmail
# 2  
Old 09-28-2017
Hi,

I'm afraid I'm not quite fully understanding what might be the problem here. As it stands, your mail command syntax is fine and valid. So as long as TestEmail is a valid local user on your system, or a correctly-defined alias in your system's mail server configuration files, then the mail should work.

In order to dig deeper here, you'll need to look at the mail server logs for your system. They should reveal what happened to the mail, and if it was rejected or bounced they should also give you a clue as to why. On most Linux systems this will be /var/log/maillog, and you'll be able to look at it as root.

I hope this at least gives you some pointers as to where to look next. If you need further assistance then if you can give us a lot more detailed information about what you're doing, about what errors you're getting, and how exactly TestEmail is set up (either as a valid local user or as an alias, and if so please include its full entry in your mail server's config files), and hopefully we can go on from there.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Sending an email using mutt...

I wanted to send "config.log" to the usergroup that handles open source support for Octave 3.8.0, a programming language as there were build errors. In order to send an email from unix command line, I am trying to use mutt, and I need a straightforward way of sending emails, as the commands... (1 Reply)
Discussion started by: jon80
1 Replies

2. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

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

4. UNIX for Dummies Questions & Answers

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. (7 Replies)
Discussion started by: forumsrahul
7 Replies

5. Linux

sending an email

I have used an already-built ActiveX control to send email from my asp web pages. One of the parameters I fill is FromName which defines the tittle the recipient will see in the From entrance in his Inbox. Now Iīm trying to use mail to send an email from a Shell but I havenīt found the... (1 Reply)
Discussion started by: RandomAccess
1 Replies

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

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

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

9. UNIX for Dummies Questions & Answers

sending email

hi, is there any possiblity to send email from the command prompt, for eg i want to send alert to any mail id like /data/logs is 80% to my hotmail account , xxx@hotmail.com is this really possible,, if not, then what are the prerequistes need to do this (1 Reply)
Discussion started by: vasikaran
1 Replies

10. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies
Login or Register to Ask a Question