Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sending mail to multiple recipient added in a text file Post 302936341 by Gurkamal83 on Tuesday 24th of February 2015 09:24:24 PM
Old 02-24-2015
Sending mail to multiple recipient added in a text file

I am trying to find a code that can help me mail to a list of recipients which are in a text file.

Sample code
Code:
$cat recipient.txt
me@test.com
me1@test.com
me2@test.com

I want a mailx step that can read contents of recipient.txt and mail to all the users.

I don't want to use mails coded as a part of script. mails should be in text file

Code:
xemails="cameron@SomeDomain.com,someoneelse@SomeDomain.com"
#
function SendEmail {

  xsub="Some Subject Of Your Choosing."
  mail -s "$xsub" $xemails < $1

}  ## End-of-function SendEmail


Last edited by rbatte1; 02-25-2015 at 06:44 AM.. Reason: Removed auto-EMAIL tags. Added CODE tags and corrected spellings/case
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to attach a txt file while sending mail

Hi, I need to attach a txt file while sending mail thru Unix. Please help me out in this.. -Charan. (9 Replies)
Discussion started by: charan81
9 Replies

2. UNIX for Advanced & Expert Users

sending mails with attachment and also some text in mail body

Hi, Can some one help me with the syntax of the mailx that should send an attachment and also some text in the message body together. When I am using the following syntax it is not sending the attachment but only the message body. unix2dos -ascii $REPORTFILE | uuencode $PCFILE | mailx -s... (7 Replies)
Discussion started by: guptan
7 Replies

3. UNIX for Dummies Questions & Answers

Sending mail in the dead.letter file

Sorry for this one ladies and gents, it's probably very easy but I don't know how to, sound familiar :-) I'm using sendmail on a web server that sends some mail through forms, not many. I've got sendmail configured to use our networks relay host and everything was working well. The power... (4 Replies)
Discussion started by: mjdavies
4 Replies

4. Shell Programming and Scripting

Get the latest added part of a text file?

Hi, I want to get the latest added part of a text file sent over the network to for analysis. Is there a tool to use to keep track of which part of a text file that has already been analysed so only the "new" lines will be sent and handled? I have checked a few tools but I still donīt know how to... (3 Replies)
Discussion started by: pcrs
3 Replies

5. Shell Programming and Scripting

I want Trailer to be added into the text file.

Hi folks, I want Trailer to be added into the txt file the format is below. flatfile-> abc.txt count of the file is 500 records. I want the trailer in this format: TRAILER|500 (pipe delimeter). Please suggest the comands ASAP. Rgds Ann (5 Replies)
Discussion started by: Haque123
5 Replies

6. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

7. Shell Programming and Scripting

mailx -s not sending the file to mail address

Hi All, OS:Red Hat Linux 4 86x64 Below is my shell script which is not sending mail to the mail recipient: #!/bin/bash export MAILLIST="xyz@yahoo.com" cd <path_to_the_script_perf_report.sql> sqlplus / as sysdba @perf_report.sql if then cat <path_to_the_script/*MONTHLY*REPORT*.lst... (6 Replies)
Discussion started by: a1_win
6 Replies

8. Shell Programming and Scripting

Echo - Sending mail to multiple addresses

Hi, If I want my script to send a mail to multiple recipients I can do the following: if then echo $err_string1 | mailx -s "UAT CPU ALERT" 1@email.com echo $err_string1 | mailx -s "UAT CPU ALERT" 2@email.com fi Can this also be done something like: ... (1 Reply)
Discussion started by: runnerpaul
1 Replies

9. Shell Programming and Scripting

sending multiple files along with mail message using uuencode

Hi, I have a requirement to send a mail with multiple files attached to it and along with the text message in the mail. I am trying sumthing like below but it only sends me the text message and no files attached to the mail. ---------------------------------------- ( uuencode file1... (1 Reply)
Discussion started by: sachinkl
1 Replies

10. Shell Programming and Scripting

Mail sending with multiple attachement(pdf and csv) with html content from Linux

Hi, We have a requirement to send multiple attachment(pdf and csv) along with html content in a single mail. For that we are using uuencode. It is working for single pdf attachment and html content. But we are unable to send both pdf and csv attachment with html content. Below is the script.... (5 Replies)
Discussion started by: dholea
5 Replies
mlmmj-process(1)					      General Commands Manual						  mlmmj-process(1)

NAME
mlmmj-process - process mail for an mlmmj managed mailinglist SYNOPSIS
mlmmj-process -L /path/to/list -m /path/to/mail [-h] [-P] [-V] -h: This help -L: Full path to list directory -m: Full path to mail file -P: Don't execute mlmmj-send (debugging only) -V: Print version DESCRIPTION
This is the binary which processes a mail. Examples of what such processing is: o Access control Using the access rules specified in <listdir>/control/access to perform access control to the list. This is done before headers are stripped, so one can create allow rules based on headers that are later stripped. o Header stripping Headers specified in <listdir>/control/delheaders are deleted from the mail. o Header addition Headers specified in <listdir>/control/customheaders are added to the mail. This could be headers like List-ID: or Reply-To: o List control In case there's a mail with a recipient delimiter it's not a regular list mail. Processing of these happens in mlmmj-receive as well. Examples of such are subscription requests, mails to owner etc. It will base it's recipient delimiter detection on the Delivered-To: header if present. If not, the To: header is used. o Moderation If the list is moderated, it will happen in mlmmj-process. When processing is done, it will invoke the needed binary according to whatever mail it is. If it's a subscription request it will invoke mlmmj-sub, if it's a regular list mail it will invoke mlmmj-send. SEE ALSO
The file TUNABLES from the mlmmj source distribution or in the documentation directory of the operating system distribution. AUTHORS
This manual page was written by the following persons: Soren Boll Overgaard <boll@debian.org> (based on html2man output) Mads Martin Jorgensen <mmj@mmj.dk> mlmmj-process September 2004 mlmmj-process(1)
All times are GMT -4. The time now is 12:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy