E-mail notification for database record additions

MySQL expert Mike Hillyer recommends using a combination of a trigger and a user-defined function in order to setup automatic e-mail notification of record additions.

How can I set up my MySQL 4.0 database so that I get e-mail notification each time a record is added? Is there a way to do is using a shell or PHP script?

The simplest way is to add an e-mail send to the application adding the data. In MySQL 5.0, you could use a combination

of a trigger and a user-defined function (UDF) to do this, with the UDF calling some form of C function for sending email.

This was first published in April 2006

Dig deeper on Open source databases

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: