I am currently working on specifying a piece of software whereby generated emails will be a large part of the system.
On investigation I can pull all the information I require out of the database and create an email with attachments and send them using the database’s built in mail functionality (both Oracle and SQL Server).
My other option is to generate the email in my application code.
As I don’t need any fancy formatting on the email, what would be the best way to do this? There seems to be no difference in terms of achieving my goal; the only benefit of using the DB is that I can set the email to be sent on the trigger of a row being updated.
I’d do it in the application code. Leave the data storage to the database, and leave the application logic to the application.