Multiple recipients for sp_send_mail

  • Hi there,

    Just a small bit of help...

    Trying to get my head round sending an sp to multiple emails. I currently have this but obviously it's not qute right....

    exec msdb.dbo.sp_send_dbmail

    @profile_name=[Public Profile],

    @recipients='email1@workplace.co.uk';'email2@workplace.co.uk';'email3@workplace.co.uk',

    @subject = 'Total Open Calls',

    @query = "query",

    @attach_query_result_as_file = 1,

    @query_attachment_filename ='QueryResults.txt'

    Thanks as I am sure this is an easy one. My brain is clearly mush right now....

  • from memory you quote the entire list, not each email address;

    exec msdb.dbo.sp_send_dbmail

    @profile_name=[Public Profile],

    @recipients='email1@workplace.co.uk;email2@workplace.co.uk;email3@workplace.co.uk',

    @subject = 'Total Open Calls',

    @query = "query",

    @attach_query_result_as_file = 1,

    @query_attachment_filename ='QueryResults.txt'

  • It's a dumb day for me...thank you worked perfectly!

  • Nobadys' is perfect you learn it from your silly mistakes :-D.

    Abhijit - http://abhijitmore.wordpress.com

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply