Mssql Server 2008

Hi I have a sql server Job with 4 steps.I want to send a email notification when any one of step fails.In my email there are 'To' and 'CC' Recipients.Can some one please let me know how to do  this.I don't want to do this with db mail.Can I do this by  using .NET code  in the job.

Who is Participating?
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Possible, but more cumbersome. Most source examples for VBS use CDO for sending mails, like in (just one of many you'll find on EE).

Using the stored procedure sp_sendmail is another way, but I guess you do not want to use that (as it is server-based).
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You can do that with PowerShell:
Send-MailMessage -SmtpServer -To "" -From "" -CC "" -Subject "Error in job" -Body "Whatsoever happened" 

Open in new window

Call this as a failure operation for each job step.
vijay11Author Commented:
HI Qlemo,

Can I do this in Job as ActiveXscript using Vb script?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.