DECLARE @object int
DECLARE @hr int
EXEC @hr=sp_OACreate 'CDONTS.NewMail',@object OUT
EXEC @hr=sp_OASetProperty @object,'From','Your Friend'
EXEC @hr=sp_OASetProperty @object,'Body','This is a test'
EXEC @hr=sp_OASetProperty @object,'Subject','Test of CDONTS'
EXEC @hr=sp_OASetProperty @object,'To','somebody@somewhere.com'
EXEC @hr=sp_OAMethod @object,'send',NULL
EXEC @hr=sp_OADestroy @object
GO