Database mail not sending Reply email to multiple recepients

  • Hi,

    I configured the database mail and its working fine if I add only one recepient. But Its sending NO email if I add two recepients separated by semicolon(;)

    and I also I tried by adding 2 recepients separated by ; in Operator. please see the attachments and advice how can I send email to multople recepiets.

    Thanks

  • hi,

    In database mail,Sending email to multiple recipients is possible or not? If yes please tell me how to achieve that.

    thanks

  • not on the screens you were setting up; that set up the profile, where it is only one account.

    if you want replys to any email to go to multiple persons, you need to set up a group on your email server, so stuff like 'sales @yourdomain.com' gets resent by your server to other, multiple emails.

    replyto: expects a single email;

    To:,CC: and BCC: are the onyl fields that expect multiple email addresses.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks Lowell,

    Iam able to create a group abc@xyz.com(which consists all the DBA's email addresses) and database mail sending email when the job succeeded. But I want an email to send an operator(ops@xyz), when the job fails.

    So Iam not able to get these 2 done together i.e

    Send an email to abc@xyz.com when job succeeds and send an email to ops@xyz when job fails?

    how to acheive the above? is there any way to give To: Cc: in the dbmail configuration?

  • thanks Lowell,

    Iam able to create a group abc@xyz.com(which consists all the DBA's email addresses) and database mail sending email when the job succeeded. But I want an email to send an operator(ops@xyz), when the job fails.

    So Iam not able to get these 2 done together i.e

    Send an email to abc@xyz.com when job succeeds and send an email to ops@xyz when job fails?

    how to acheive the above? is there any way to give To: Cc: in the dbmail configuration?

  • you'll need to handle errors a s a separate email, something like this:

    DECLARE @Results int

    EXEC @Results = msdb.dbo.sp_send_dbmail

    @profile_name = 'AdventureWorks Administrator',

    @recipients = 'danw@Adventure-Works.com',

    @body='Whatever the body was'

    ...

    if @Results 0 --error returned froms erver is error number, ie 550 no relaying, etc.

    BEGIN

    EXEC @Results = msdb.dbo.sp_send_dbmail

    @profile_name = 'AdventureWorks Administrator',

    @recipients = operators@yourdomain.com,

    @subject='Failure to send email.'

    ...--include everyone who didn't get the mail, the original body, etc for reference

    END

    if @Results 0 --cant send to the operators? server or network issue?

    BEGIN

    --log to the database, because the email server is down.

    END

    END

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • can u please tell me how u set up mail alert using database mail

  • I dont know what mechanism you are using to send email, but I create 2 steps at the end of every job I run, 1 is for success, the other is for failure. And in both of them I put the corresponding messages for them, and send them out with something similar to this:

    EXEC msdb.dbo.sp_send_dbmail

    @recipients='RKelly@dom.com;BElliott@dom.com',

    @profile_name = 'SQL_Notifier',

    @subject = 'ExTraLoader - SRD Import Success',

    @body = @table ,

    @body_format = 'HTML';

    This ALWAYS works no problems at all.

    HTH - RJK

  • This was removed by the editor as SPAM

Viewing 9 posts - 1 through 8 (of 8 total)

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