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.

Thanks
vijay11Asked:
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 http://www.experts-exchange.com/Q_26569980.html (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).
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You can do that with PowerShell:
Send-MailMessage -SmtpServer mail.source.com -To "To@target.com" -From "From@source.com" -CC "CC@target.com" -Subject "Error in job" -Body "Whatsoever happened" 

Open in new window

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

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

Thanks
0
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.