|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, February 27, 2007 5:00 PM
Points: 18,
Visits: 1
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, December 12, 2010 12:03 PM
Points: 1,
Visits: 7
|
|
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
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Yesterday @ 3:58 PM
Points: 279,
Visits: 1,025
|
|
whats is CDONTS and it will send query result in mail?
Aim to inspire rather than to teach. SQL Server DBA
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Yesterday @ 2:29 PM
Points: 3,823,
Visits: 4,046
|
|
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/
|
|
|
|