If you’re setting up Database Mail to send emails in SQL Server, you will need to have at least one Database Mail account.
You can create Database Mail accounts with T-SQL by executing the sysmail_add_account_sp
stored procedure in the msdb
database.
The Database Mail account is the account that sends the email. For example, if you have an automated email that is sent whenever a SQL Server Agent job fails, this is the account that sends that email.
You can also specify things such as a separate “reply-to” email, a display name, etc.
You can have multiple accounts for various tasks if required. Simply execute sysmail_add_account_sp
whenever you need to create a new account.
Continue reading →