Send Email From Server and Read whole line also parsing the data using awk


while read -r line;
do
email=`echo $line|awk -F";" '{print $1}'`;
pesan=`echo $line|awk -F";" '{print $2}'`;
kode=`echo $line|awk -F";" '{print $2}' | awk '{print $5}'`;
echo mengirimkan Email ke $email;
echo $pesan;
cat pesan|sed "s/pesan_me/$pesan/g" > $kode.txt;
mailme=`which mail`;cat $kode.txt | $mailme -aFrom:jne@gogole.com -s "[Google][Secret Information][ $kode ]" $email
done < list.penerima.pesan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s