Ignore my message, I thought I am reading the forum of an article...
Anyhow, it very much depends on your database, Most probably however you'll need to have C, Perl or TCL language binding for your database or any other generic language and create the code in that language to send the e-mail, it's best to read the database docs and see its examples.