I am trying to run the below script that creates 'EASendMailObj.Mail' object using 'sp_OACreate' but getting '-2147221005': 'Invalid class string' error. What could be the issue?
DECLARE @hr int
DECLARE @oSmtp int
DECLARE @result int
DECLARE @description nvarchar(255)
EXEC @hr = sp_OACreate 'EASendMailObj.Mail',@oSmtp OUT
print @hr
If @hr <> 0
BEGIN
EXEC @hr = sp_OAGetErrorInfo @oSmtp, NULL, @description OUT
IF @hr = 0
BEGIN
PRINT @description
END
RETURN End