In a sql server 2012 database, I need to send out email messages to selected users when error records are located from a specific query. I also need to send the results of the query to the users. Due to this fact, I have the following questions to:
- Is it better to send out the email messages using the database mail on sql server and/or the office 365 live outlook mail? Would you also tell me why one mail method is better than a different mail method?
- Would you show me the following about using the database mail on sql server:
a. How to setup the database mail,
b. How to attach the query results obtained to the email message,
c. How to 'connect' to the database mail when a daily scheduled job finds it needs to email the results
to various users?