sending email through informix
Posted in 2003
Topics: Triggers, Constraints & Referential Integrity
Hello All, I have a requirement to send email when a something in my table gets = updated. I have a trigger written to do some other database updates. But = i want to know how to send email through informix while trigger is = executed. Thanks in Advance, Rajendra
An idea:
call a system command from a stored procedure that insert some information
on a file.
Create some application or shell script (if UNIX) that reads the file and
sends an email.
-------------------------------------------------------------
create procedure xxx...
DEFINE cmd varchar(255);
...
...
LET cmd = 'echo "your mail message" >> /tmp/somefile'
system cmd;
end procedure;
-------------------------------------------------------------
Shell script
while [ true ]; do
if [ -f /tmp/somefile ]; then
mail user@host -s subject < /tmp/somefile
rm /tmp/somefile
fi
sleep 10
done
-------------------------------------------------------------
----- Original Message -----
From: "Rajendra" <bhat_raj@hotmail.com>
To: <ids@iiug.org>
Sent: Friday, May 23, 2003 3:42 AM
Subject: sending email through informix [1208]
Hello All,
I have a requirement to send email when a something in my table gets =
updated. I have a trigger written to do some other database updates. But =
i want to know how to send email through informix while trigger is =
executed.
Thanks in Advance,
Rajendra