SMS alert help please?

  • Hi there,

    I am trying (and failing) for one of the job notifications to be sent to a work on call telephone.

    We have a job that when it fails an alert needs to go to the on call phone. We have an email address for the phone, but for some reason the notification isn't working.

    Here below is the code that should send the alert:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name=[SQL Profile],

    @recipients= 'on_call_phone@phone.co.uk',

    @subject = 'Service Broker Queue',

    @body=@MailMessage1

    (obviously for the last bit we have already defined the mail message bit earlier in the T SQL).

    Any help is appreciated! Thanks in advance....

  • The code looks fine anyway.

    You may have done this already but I'd start with right-clicking on 'database mail' in SSMS and sending a test email, just to confirm mails are sending at all. Could it be an issue with your smtp server?

    There are a few tables in msdb that might be worth checking out as well, ie..

    sysmail_mailitems

    sysmail_sentitems

    sysmail_allitems

    sysmail_faileditems

    sysmail_unsentitems

  • thanks jmcmullen it turns out that an additional profile had been set up for the database mail so was easily solvable in the end 🙂

Viewing 3 posts - 1 through 2 (of 2 total)

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