troubleshooting Question

Issue sending to multiple addresses using sp_send_dbmail SQL 2012

Avatar of mburk1968
mburk1968Flag for United States of America asked on
Microsoft SQL Server
7 Comments1 Solution36 ViewsLast Modified:
I have the following script which for some reason is only sending the email to me.  Me being "me@email.com" Why am I unable to send to others in my domain?

DECLARE @Style CHAR(12) ,
    @BodyMessage NVARCHAR(MAX);



SELECT  @BodyMessage = N'There were no Royalty changes posted';
SELECT  @Style = T2.style
FROM    KLL_Cust.dbo.Report_RoyaltyCache T1
        FULL JOIN dbo.zzxstylr T2 ON T1.division = T2.division
                                 AND T1.style = T2.style
WHERE   T1.roy_cls <> T2.roy_cls
        OR T1.royalty <> T2.royalty;
IF @Style > = 0
    BEGIN
        EXEC msdb.dbo.sp_start_job @job_name = 'D612C861-179A-4090-94F3-19532FAC7581';
    END;
ELSE
    BEGIN
        EXEC msdb.dbo.sp_send_dbmail @recipients = 'person1@email.com; me@email.com; otherguy@email.com',
            @subject = 'Royalty Change Report', @body = @BodyMessage;
    END;
ASKER CERTIFIED SOLUTION
Brian Crowe
Database Engineer
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros