You should write the error to an error log, and then use an SSIS job running from SQL Agent to send them to email.
How to send email in sql server without configuring database mail
I'm capturing Error log table in SQL SERVER.Actually My task is when error raised in try/ catch block should be send a email to my inbox and is any possible without setting any configuring database mail and any writing SP and giving directly port numbers and mail id is possible?
2 additional answers
Sort by: Most helpful
-
Erland Sommarskog 112.6K Reputation points MVP
2020-10-05T21:28:12.28+00:00 I guess you could write a CLR procedure for the task. BUT DON'T DO IT!
Exception handlers should be simple. The last thing you want is an exception handler that fails, because then you lose the original error message, and you have no idea what the problem is. Sending mail from an error handler is definitely too complex.
And I predict that if you would actually get it going, you would grew tired of those mail pretty quick.
-
Tom Phillips 17,736 Reputation points
2020-10-08T13:52:00.543+00:00