Triggerring mail from SQL server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Triggerring mail from SQL server

Hi…
I am working in the triggering mail from SQL server.
declare @Mailobj as int
declare @hr as int
exec master.. sp_oacreate ‘dllname.clsname’, @Mailobj out,1
exec master..sp_oageterrorinfo
exec master..sp_oamethod @Mailobj,’Testmail’,null,@Toid=”,@Fromid=”,@CCid=”,@BCCid=”,@Subject=’mail’,@Textbody=’Hello world’,@strError=”
exec master..sp_oageterrorinfo Error: 0x800401F3 Source: ODSOLE Extended Procedure Error Description: Invalid class string Help file: NULL Help ID:0
Error: 0x80042725 Source: ODSOLE Extended Procedure Error Description: sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]] Help file: NULL Help ID:0
But if i execute the code below without SP_geterrorinfo, as below declare @Mailobj as int
exec master.. sp_oacreate ‘dllname.classname’, @Mailobj out,1
exec master..sp_oamethod @Mailobj,’Testmail’,null,@Toid=”,@Fromid=”,@CCid=”,@BCCid=”,@Subject=’mail’,@Textbody=’Hello world’,@strError=” The command completed successfully, but i didnt get any error message.

KBAhttp://support.microsoft.com/default.aspx/kb/243899? for relevancy. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>