Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    29

    Unanswered: Notification - How to put more email addresses?

    In the SQL Server Management Studio, I have already setup the "Database Mail", and under "SQL Server Agent", I have created an operator in the "Operators".

    In the Properties of the operator, I tried to add email addresses to the "Email name:" box under "Notification options". However it seems like there is a length limit. I entered 9 email addresses, but then started at the 5th email address to the last email address has been truncated...

    I'm not sure how I can put more email addresses...It seems like the maximum emails I can put is 4....But I need to send emails to my whole team. The worst part is we do not have a central email address for the whole team...that's why I need to put 9 addresses.....

    Any suggestion is greatly appreciated!

    Thanks!!

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Create an Exchange mailing list and add all the emails you want into that group. Then use that group in the "Email Box".

    If you don't know how (or don't have the authority) to create mail groups, talk to your Exchange guru.

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

  3. #3
    Join Date
    Oct 2008
    Posts
    46
    Use this script:

    declare @MRecipients as varchar(200)
    set @MRecipients ='aa@aa.com;bb@aa.com;cc@xyz.com'

    EXEC msdb.dbo.sp_send_dbmail @recipients=@MRecipients ,
    @subject = 'Testing Mail',
    @body = 'This is Testing';

  4. #4
    Join Date
    May 2006
    Posts
    29
    Thanks tomh53 and rajan142.

    I added a job step to send out email by using the script, and it works. However, my team lead still wants to use the Notification feature of SQL2005 instead of adding a step...For email group, we really cannot create one...sigh...

    Is there any way I can add email addresses to "Cc" in the Notification? The email addresses are all in "To" field. Maybe adding emails to "Cc" can help...

    Thanks again!

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    SQL Operator email addresses are limited to 100 characters for the "To" list. Create a group/alias for as many addresses as you like in your Exchange server and send the email to that address, the Exchange server will then send your email notification to all of those addresses.

    -PatP

  6. #6
    Join Date
    Aug 2008
    Location
    India
    Posts
    55
    If u use sp_sendmail u can add mail address in CC using @copy_receipents='email addresses'

  7. #7
    Join Date
    May 2006
    Posts
    29
    The Exchange server admin does not allow us to create a group/alias.....

    So basically, if I do not create a group and do not use script, I have no way to send to email addresses that exceed the 100-character limit at the "To" list...

  8. #8
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Quote Originally Posted by pchiu
    The Exchange server admin does not allow us to create a group/alias.....
    Then take the Exchange Admin to lunch and ask nicely ... or tell your boss to have a talk with his boss. If it's a business need, I'm sure you can find a way to justify it!

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

Posting Permissions

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