Answer the question
In order to leave comments, you need to log in
What is a good notification script?
Greetings!
Share a link or script to send notifications.
Task:
There is a file of the form
name @domen .ru 00001
12/21/12 [email protected] 00002 12/22/12
[email protected] 00003 12/23/12
, etc. generated by a script in oracle.
It is necessary to send notifications to the specified addresses in column 1, with the body specified in the second and third columns. The theme may be the same. Your mail server. Number of recipients: several hundred people per day.
I look towards mutt, but so far at the level of reading manuals.
Answer the question
In order to leave comments, you need to log in
We take something like mailutils (just the first thing that came across to send letters from the script) and write something like:
#!/bin/bash
cat $1 | while read line
do
MAIL=${line%% *} #отрезаем от строки line все что после первого пробела включительно
BODY=${line#* } #отрезаем все, что до первого пробела включительно
echo $BODY | mail $MAIL
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question