There is an option like that of course it depends on the particular SQL you are using MySQL or NoSQL database, they should have their own approach to this, check the link below.
https://www.c-sharpcorner.com/article/configure-database-mail-send-email-from-sql-server-database/