Solved

Sending to multiple recipients using sp_send_dbmail

Posted on 2008-06-26
3
10,053 Views
Last Modified: 2010-05-18
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = 'eoin.conway@meteorelectrical.com',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'

how do i add another email address?
0
Comment
Question by:meteorelec
3 Comments
 
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


GOD BLESS,

Aneesh R.
0
 
LVL 2

Author Comment

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

0
 
LVL 13

Accepted Solution

by:
rickchild earned 500 total points
ID: 21876432
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '1',
@recipients = 'eoin.conway@meteorelectrical.com; richard@meteor.com; sam@meteor.com',
@subject = 'subject',
@body = '',
@query = @sql,
@execute_query_database = 'demo'
EXEC msdb.dbo.sp_send_dbmail 

@profile_name = '1',

@recipients = 'eoin.conway@meteorelectrical.com; richard@meteor.com',

@subject = 'subject',

@body = '',

@query = @sql,

@execute_query_database = 'demo'

Open in new window

0

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.

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

11 Experts available now in Live!

Get 1:1 Help Now