Another day brings a new issue but Happy Friday!
I need to be able to loop thru rows and send an email to the appropriate recipients. I'm retrieving the recipient addresses from a table and placing them into a variable
For example @recipients = '@WhoToSendTo',.
Declare @WhoToSendTo varchar(250);
Set @WhoToSendTo = 'MyEmailAddy.com';
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'MyProfile',
@recipients = '@WhoToSendTo',
.
.
.
But sp_send_dbmail queus the mail but doesn't send, it gives this error:
Cannot send mails to mail server. (A recipient must be specified.
Any ideas?