sp_send_cdosysmail supported in SQL 2008?

  • Greetings, all!

    I'm just starting to do some development on our new 2008 server. I'm copying over some code that we use in 2005 that includes a call to sp_send_cdosysmail during the error handling. We haven't created sp_send_cdosysmail on our 2008 server and I've been trying to make sure it's still supported before I do so, but with no luck.

    We're using the code from http://support.microsoft.com/kb/312839 with the following conditionals for attachments, CC, and BCC fields added in just before Send is executed:

    IF @FilePath IS NOT NULL

    BEGIN

    EXEC @hr = sp_OAMethod @iMsg, 'AddAttachment', NULL, @FilePath

    END

    IF @cc IS NOT NULL

    BEGIN

    EXEC @hr = sp_OASetProperty @iMsg, 'CC', @cc

    END

    IF @BCC IS NOT NULL

    BEGIN

    EXEC @hr = sp_OASetProperty @iMsg, 'BCC', @BCC

    END

    I was wondering if anyone knows:

    1) if it's supported as-is so I can copy the stored procedure up without any changes

    2) if it's supported but with modifications required (and if so, what I'd need to do for it to work)

    or

    3) if it's not supported and there's an alternative available

    Thank you in advance,

    Jennifer

    Jennifer Levy (@iffermonster)

  • Can't answer your question about sp_send_cdosysmail, but I would suggest looking at Database Mail.

  • I join Lynn in the advise !

    sp_send_dbmail is the way to go !

    Have a look in books online to see how (easy) sp_send_dbmail can serve you.

    It has nice features (profiles, ...)

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Thanks, both of you! I'm checking it out now. Looks like we have Database Mail configured on the server, so this would be the way to go.

    --Jennifer

    Jennifer Levy (@iffermonster)

  • What might help is creating a proc sp_send_cdosysmail and calling sp_send_dbmail from it thereby not having to adjust the existing code you have calling sp_send_cdosysmail.



    Shamless self promotion - read my blog http://sirsql.net

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply