-1

I want to send an email if someone has not returned their checked out item back into the system. If current date is > return date, then an email will be sent notifying the user that they need to return their item.

I came across MySQL events, and am wondering if it is possible to create a MySQL event that sends an email if a certain condition is met.

I'd like my event to send emails to the user who has not returned the item.

Matthew
  • 27
  • 1
  • 8

1 Answers1

0

No, there's no native "send email" function in MySQL database server.

As far as MySQL EVENT, it is possible to execute queries, and check conditions, and perform DML operations i.e. insert/update/delete row(s) e.g. into a queue table. And another "client" can run a query against the queue table, and send email.


It is possible to incorporate additional functionality into the MySQL server by creating a user defined function. But IMO that's a chase down the wrong rabbit hole.

https://dev.mysql.com/doc/refman/8.0/en/adding-functions.html


Please refer to other questions on the same topic of sending email from MySQL server.

as a starting point:

https://stackoverflow.com/search?q=can+you+send+email+from+mysql+event

spencer7593
  • 106,611
  • 15
  • 112
  • 140