简体   繁体   English

在数据库中插入一行后,如何自动发送电子邮件?

[英]how to send an e-mail automatically when a row is inserted in the database?

I have to develop a application with the following scenario: 我必须在以下情况下开发应用程序:

1--User create a profil (name,lastname,address....) 1-用户创建一个配置文件(名称,姓氏,地址...)

2--The information are inserted in the database 2--将信息插入数据库

3--The administrator should receive an e-mail to be notified by the new profil ,if the administrator dont approve the profil he will delete it. 3--管理员应该收到一封电子邮件,通知将由新的配置文件通知,如果管理员不批准该配置文件,则将其删除。

Is there a way to send automatically an e-mail when a row is inserted in the database? 当在数据库中插入一行时,是否可以自动发送电子邮件?

I'm using java. 我正在使用Java。

If you are doing this through a common interface, then I'd suggest putting a seperate call next to the insert routine (between Java and database). 如果您是通过通用接口执行此操作,则建议在插入例程旁边(在Java和数据库之间)放置一个单独的调用。

I heard you can do a whole lot of things with triggers in MS SQL, but I was told to keep my hands away from triggers. 我听说您可以使用MS SQL中的触发器来完成很多事情,但是有人告诉我要远离触发器。 Made by the devil to make a day turn bad. 恶魔使一天变得糟透了。 People that has succesfully mastered triggers will tell you otherwise. 成功掌握了触发器的人会告诉您其他情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM