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 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy