I have a query which gives set of rows containing Email-Id with respective Names.
Below is stored procedure which sends mail to 1 person at a time.
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'MyUsername@xxx.com',
@TO = N'FriendsUsername@yyy.com',
@priority = N'HIGH',
@subject = N'Hello SQL Server SMTP Mail',
@message = N'Goodbye MAPI, goodbye Outlook',
@type = N'text/plain',
@server = N'aaaaa'
select RC = @rc
My question is how do I write a stored procedure which sends mail to all the people who are in there result set of query with one person at a time using the above stored procedure
Thanks
Shivali
Below is stored procedure which sends mail to 1 person at a time.
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'MyUsername@xxx.com',
@TO = N'FriendsUsername@yyy.com',
@priority = N'HIGH',
@subject = N'Hello SQL Server SMTP Mail',
@message = N'Goodbye MAPI, goodbye Outlook',
@type = N'text/plain',
@server = N'aaaaa'
select RC = @rc
My question is how do I write a stored procedure which sends mail to all the people who are in there result set of query with one person at a time using the above stored procedure
Thanks
Shivali