Hi Gurus,
I need to create a a batch file which will send an email notification to all the sysadmin that we are shuting the SQL Server. I am not able to use xp_smtp_sendmail. Iam writing this tsql in the Query analyzer but receive the following error.
Query:
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'MyEmail@MyDomain.com',
@FROM_NAME = N'Joe Mailman',
@TO = N'mamin@sapient.com.com',
@cc = N'MyOtherFriend@HisDomain.com',
@BCC = N'MyEmail@MyDomain.com',
@priority = N'HIGH',
@subject = N'Hello SQL Server SMTP Mail',
@message = N'Goodbye MAPI, goodbye Outlook',
@type = N'text/plain',
@attachments= N'c:\attachment1.txt;c:\attachment2.txt',
@server = N'mail.mydomain.com' -- my company'd relaymail id
select RC = @rc
go
Error:
========
Msg 2812, Level 16, State 62, Line 2
Could not find stored procedure 'master.dbo.xp_smtp_sendmail'.
Please help me out to achive my goal. Need to send an email from a batch file regarding the server outage.
Please help !!!
"More Green More Oxygen !! Plant a tree today"