I would like to send emails from SQL Server 2008.
Here is my code:
USE mydatabase
declare @keywords nvarchar(3000)
Select @keywords = null
SELECT
@Keywords = Coalesce(@Keywords + '; ', '') + Email
from
SharedDataUser
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'MyTestProfile',
@recipients=@keywords,
@subject = 'Test mail'
I am able to send email by database mail.
Issue
I am sending mail to multiple users. Each user has different due date and I need to send that due date with email body. I didn't find the way. Can anyone help me?
Thanks in advance