Look up PHPMailer, in my experience it really is the best option. You can of course use the php mail() function, however, it does depend on a local mail server, wheras PHPMailer can connect through SMTP. https://github.com/PHPMailer/PHPMailer
Once configured correctly, you can easily make calls to PHPMailer to construct a message. Simply place that code once your database function returns true.
If you doubt is who to know when to send an email, i see two options for you:
Use cron jobs that will run at specific intervals, identify the new records and send the e-mail. This way you can do it easily with PHP but you'll need to have some flag to know if that record was already mailed or not.
Use a trigger on your SQL Server that will run and external command (probably call your PHP mailing page) each time a record is created.