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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", 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.
vijay11Author Commented:
HI Qlemo,

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

Thanks
Qlemo"Batchelor", 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).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.