Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    46

    Unanswered: Can You Setup Database Mail to Notify Multiple Users?

    I want to configure database mail to send out an email to three different email addresses when a maintenance plans completes successfully.

    Is there a way to do this? I noticed that I can create a profile and attach multiple accounts to the profile. But when I right click on the job under SQL server agent, it only allows me to select one email address under Notifications. Thanks.

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Code:
    Exec msdb.dbo.sp_send_dbmail 
     @profile_name = 'GenericMailProfile',
     @recipients = 
    'someone@somewhere.com; bozo@SomewhereNotHere.net; bob@accounting.com; ocrud@white_house.gov', 
     @subject = 'Message for Subject line - Success'

    -- This is all just a Figment of my Imagination --

  3. #3
    Join Date
    Jan 2009
    Posts
    46
    Quote Originally Posted by tomh53
    Code:
    Exec msdb.dbo.sp_send_dbmail 
     @profile_name = 'GenericMailProfile',
     @recipients = 
    'someone@somewhere.com; bozo@SomewhereNotHere.net; bob@accounting.com; ocrud@white_house.gov', 
     @subject = 'Message for Subject line - Success'

    Thanks. I ran this sp, and it does generate the email to multiple users when the job is executed. However, the email only displays what I entered for subject. It doesnt show if the job failed or completed. Am I missing something here?

  4. #4
    Join Date
    Aug 2006
    Location
    San Francisco, CA
    Posts
    136
    Maintenance plans run as jobs and thus you can create an operator with multiple e-mails addresses and set the job to notify the operator in case of a failure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •