May 14, 2008 at 4:56 am
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"
May 14, 2008 at 5:35 am
xp_smtp_sendmail is not a system extended stored procedure that comes with SQL Server.
I think it is a third-party product that you need to install.
Why wouldn't you use database mail (which uses SMTP)? IT ships with SQL Server.
May 14, 2008 at 5:43 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply