Sponsored Content
Full Discussion: script broadcast email
Top Forums Shell Programming and Scripting script broadcast email Post 302673107 by survive on Tuesday 17th of July 2012 12:46:44 PM
Old 07-17-2012
<Solved> script broadcast email

Dear All need advice,

I just want broadcast email with mail from shell script, where the script look up the file that contain email address and password

Code:
#!/bin/bash
SUBJECT="Mailserver Baru"
ISIEMAIL="/tmp/emailmessage.txt"
 for a in `(sed 's/"//g;s/\,.*//g' $1)`;
do
echo > $ISIEMAIL
EMAIL="$a"
echo "Dear $a" >> $ISIEMAIL
{  

for b in `sed 's/"//g;s/^.*\(........\)$/\1/g' $1`;
	do
{
echo; echo >> $ISIEMAIL
	echo "Kami sedang mengupgrade system email server, password email $EMAIL yang baru adalah $b" >> $ISIEMAIL
	echo "Mohon segera mengganti password anda dengan mengakses alamat berikut" >> $ISIEMAIL
     };
done;
echo; echo >> $ISIEMAIL
   };
break;
done;
/usr/bin/mail -s "$SUBJECT" "$EMAIL" < $ISIEMAIL 
echo > $ISIEMAIL

content of $1 ;

"admin@somedomain.com","#97ukjkl"
"agung@mydomain.com","2adfpkjg"

the output after execute command ;

Dear admin@somedomain.com

Kami sedang mengupgrade system email server, password email admin@somedomain.com yang baru adalah #97ukjkl
Mohon segera mengganti password anda dengan mengakses alamat berikut

Kami sedang mengupgrade system email server, password email admin@somedomain.com yang baru adalah 2adfpkjg
Mohon segera mengganti password anda dengan mengakses alamat berikut

$a = wrong, because just read admin@somedomain.com
$b = right, because read on password field from each line

myquestion is ;

how can i use this script correctly, i mean execute line by line and looping till done

need your advice

Last edited by survive; 07-18-2012 at 08:09 AM.. Reason: Solved
 

10 More Discussions You Might Find Interesting

1. IP Networking

broadcast address

What is the significance of the broadcast address? (1 Reply)
Discussion started by: 98_1LE
1 Replies

2. UNIX for Dummies Questions & Answers

broadcast email???

Hi all, How can i send email to all the users on a box? Thank you all (1 Reply)
Discussion started by: solvman
1 Replies

3. Shell Programming and Scripting

shell script queries: $home; broadcast ping

Dear all, This is the Bionic Fysh again. I have two quick questions: 1- when writing shell scripts, how does one allow the tilda ~ into the script ? e.g ls ~; ls ~me; user=you; ls ~$user (N.B I think that for this one you need: ls `~$user`) 2- In FreeBSD 4.0, I would like for a... (6 Replies)
Discussion started by: bionicfysh
6 Replies

4. UNIX Desktop Questions & Answers

broadcast

Can anybody hellp me troubleshoot this error. Using HP-Uxix B.10.X " *****ARPA/9000 NETWORKING***** Mon Jun 30 SAT 2003 20:18:12.xxxxxxx DISASTER Subsys: NS_LS_PROBE LOC:01001 Network NS_LS_PROBE DISASTER 1001, pid arp: ether address is broadcast for IP address zzzzzzz! " where... (1 Reply)
Discussion started by: SEB
1 Replies

5. Programming

How to broadcast a message ?

My problem definition is ,I have to send a message from one node in a network and it has to be broadcasted to all other nodes in the network.The program what I have given below will be running in all the nodes in the network.The same program should be capable of sending(broadcasting) and receiving.... (0 Replies)
Discussion started by: vigneshinbox
0 Replies

6. Shell Programming and Scripting

Shell script to give broadcast and network address

Hello, I am running a post script in autoyast where I am trying to set the broadcast and network address. I have the ip address and netmask already (reading from a file).. I saw the post from fpmurphy but it is using ksh which isn't an option in autoyast. Thanks in advance! (3 Replies)
Discussion started by: bloodclot
3 Replies

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

8. IP Networking

how to do udp broadcast with multithreading

hello to all i want to use multithreading to my UDP broadcast server client program. will anyone help me by proving C code. i am working in fedora. also my requirement is POSIX compliance.please help me..... (0 Replies)
Discussion started by: moti12
0 Replies

9. Programming

how to do udp broadcast with multithreading

hello to all i want to use multithreading to my UDP broadcast server client program. will anyone help me by proving C code. i am working in fedora. also my requirement is POSIX compliance.please help me..... (6 Replies)
Discussion started by: moti12
6 Replies

10. AIX

Broadcast on AIX

hello how to disable brodcast from AIX 5.3 ? user get on workstation massage from root thx (3 Replies)
Discussion started by: ariec
3 Replies
pygm2n(1)						    Python Gateway mail to news 						 pygm2n(1)

NAME
pygm2n - Python Gateway mail to news SYNOPSIS
pygm2n -n newsgroups [ -s newsserver ] [ -h ] DESCRIPTION
IMPORTANT: this man page is to be continued. The Whole pyg gateway is in devel. state. try -h option for more detailed option. pygm2n reads from stdin an email, sending it to newsgroups, a comma separated list without spaces of newsgroup names (at least one), rfc799 compliant. If pygm2n reads from stdin a sigle line starting with /, it is considered an absolute path to a single-email mailbox, so pygm2n will open and read it. Note that now pyg can't read a real mailbox, with many emails. If you give it in input, pyg will post the whole mailbox as a single email. EXAMPLES
There is some documetation in /urs/share/doc/pyg I created mailgate user (moderator of local.moderated ng). Subscribe to a list with this user (or simply email one message to). Every email posted to this user will send to newsgroups, in its .procmailrc I've put something like: :0 bh * ^From *mailinglist-request@lists.debian.org | $HOME/pygm2n -n local.debian.mailinglist AUTHORS
Cosimo Alfarano <alfarano@students.cs.unibo.it> BUGS
Boh. send any bug, advice or opinion to the author, please. Sun Sep 12 18:10:00 CEST 2000 pygm2n(1)
All times are GMT -4. The time now is 05:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy