September 23, 2007 at 6:18 pm
Comments posted to this topic are about the item Sending mail using CDONTS and Sql Server
December 12, 2010 at 11:13 am
Will this still work on a server running in 64 bit.
I am getting this message
SQL Mail does not work with the 64-bit version of SQL Server Microsoft SQL Error 17938
January 10, 2012 at 7:33 am
whats is CDONTS and it will send query result in mail?
April 2, 2012 at 9:15 am
I could not get Database Mail to work on a Server so I tried CDONTS.
I used the following code:
DECLARE @From varchar(100)
DECLARE @To varchar(100)
DECLARE @Subject varchar(100)
DECLARE @Body varchar(4000)
DECLARE @cc varchar(100)
DECLARE @BCC varchar(100)
SET @cc = Null
SET @BCC = Null
DECLARE @MailID int
DECLARE @hr int
SET @From = 'jblow@.com'
SET @To = 'jblow@.com'
SET @Subject = 'Testing'
SET @Body = 'Testing'
EXEC @hr = sp_OACreate 'CDONTS.NewMail', @MailID OUT
EXEC @hr = sp_OASetProperty @MailID, 'From',@From
EXEC @hr = sp_OASetProperty @MailID, 'Body', @Body
EXEC @hr = sp_OASetProperty @MailID, 'BCC',@BCC
EXEC @hr = sp_OASetProperty @MailID, 'CC', @cc
EXEC @hr = sp_OASetProperty @MailID, 'Subject', @Subject
EXEC @hr = sp_OASetProperty @MailID, 'To', @To
EXEC @hr = sp_OAMethod @MailID, 'Send', NULL
EXEC @hr = sp_OADestroy @MailID
I get command executed sucessfully.
I can sent via telnet but no other method works.
Any suggestions?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 4 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