I'm a little rusty with SQL, been away a while.
I have SQL Mail set up, and I can get a test email with my company email. Good
I set up an operator, with my same email, and checked "Enabled".
I ran a Scheduled Job, with Notifications -> Email -> My Operator name -> "When the job completes"
I run the job, but no email notification.
Am I missing something ?
July 31, 2025 at 10:02 pm
I'd start by following the Microsoft advice for troubleshooting this - https://learn.microsoft.com/en-us/troubleshoot/sql/tools/troubleshoot-database-mail-issues
If that doesn't help, then you may want to check your spam folder or outlook rules that may be grabbing the email. If that isn't it, I'd reach out to the mail admin to have them check if the message may have been flagged and isn't being allowed through.
Since the test email works, I suspect it isn't a configuration issue and that's where the official docs for troubleshooting is where I'd start. If it is urgent, I'd ask the mail (Exchange?) admin to check their logs while you review the SQL side of things. That way you are covering all of your bases at once.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Ensure that the SQLAgent has been setup correctly also to use mail.
If you have not set the Agent properties Alert System to use DBMail and the profile and restarted the agent service it won't be able to automatically email operators on job complete/success/failure or when a alert is fired.
Otherwise if you don't want to do this step you will need to code manual sp_send_dbmail commands as steps and ensure the job step logic falls into the right step for emailing success of the job or failure of the job.
August 1, 2025 at 12:42 pm
For now, I am able to add a step to the job to send an email if the previous backup step failed.
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'XXXXX_MailProfile',
@body = 'Failure Email From Application DB Backups',
@body_format ='HTML',
@recipients = 'MyName@MyCompany.com',
@subject = 'Application DB Backups Failed' ;
August 1, 2025 at 1:06 pm
Ensure that the SQLAgent has been setup correctly also to use mail.
If you have not set the Agent properties Alert System to use DBMail and the profile and restarted the agent service it won't be able to automatically email operators on job complete/success/failure or when a alert is fired.
Thanks ! I missed the "Enable Mail Profile" check box ... D'OH !!
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply