declare @i intdeclare @ret intdeclare @intRetCode intexec @intRetCode = sp_OACreate 'Basp21', @i out // Basp21 is to call the engineering component of life, if there is a class name, but also add EXEC @intRetCode = sp_OAMethod @ i, 'sendmail ', @ Ret Out,' 192.168.1.19, 'xx@xx.net.cn', 'XX@xx.net.cn', 'happy', 'newyear', '' // sendmail is the function to be called EXEC SP_OADESTROY @i
Register first before using COM components