Sending to multiple recipients using sp_send_dbmail

Posted on 2008-06-26
Last Modified: 2010-05-18
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = '',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'

how do i add another email address?
Question by:meteorelec
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 21876225
Hello meteorelec,

sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
    [ , [ @recipients = ] 'recipients [ ; ...n ]' ]
    [ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
    [ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]

recipients should be separated by semicolumn


Aneesh R.

Author Comment

ID: 21876260
so how would i put that into my current code?

LVL 13

Accepted Solution

rickchild earned 500 total points
ID: 21876432
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = ';;',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'
EXEC msdb.dbo.sp_send_dbmail 

@profile_name = '1',

@recipients = ';',

@subject = 'subject',

@body = '',

@query = @sql,

@execute_query_database = 'demo'

Open in new window


Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now