populating @recipients value using msdb.dbo.sp_send_dbmail from a database table
Posted on 2008-10-09
I'm using the stored procedure msdb.dbo.sp_send_dbmail in sql server 2005 to send out emails.
I need to be able to send emails to email addresses stored in a table called emailadd. The msdb.dbo.sp_send_dbmail stored procedure uses the @recipients parameter to guage who the email is sent to, for example:
@recipients = 'email@example.com; firstname.lastname@example.org,
rather than hard coding these values i want the values to be derived from the emailadd table so that if the email addresses change in the table, the email will go to the right people.