• opc.three (6/13/2012)


    Jeff Moden (6/13/2012)


    Also, why would you recommend using "Database Mail" instead of CDOSysMail?

    One of the primary reasons is to make sending email from the database an asynchronous operation. When send an email using Database Mail you're actually adding a message to a Service Broker queue. The work of actually trying to deliver that email to an SMTP relay is done later.

    Ancillary benefits include not having to install additonal components onto the databse server and avoiding the use of OLE Automation procs, possibly allowing you to leave the, disabled on the instance.

    If you consider leaving OLE Automation procs off a benefit, then yes, I agree. Of course, that all falls into whether you have a properly locked down system or not.

    I need to double check on the asynchonus part.

    One advatage that I've found with CDOSysMail is that (according to the infrastructure team where I work) you don't have to make any special setup in a clustered envirionment like you do with Database Mail. To be absolutely honest, I trust those folks and have not done a deep dive to find out what they meant. I'll try to find out more on that subject.

    Another advantage is that I've found that Database Mail won't necessarily send to the outside world (send alerts to my private email, which I check more often, and to certain support vendors) whereas CDOSysMail will send to anyone you need it to.

    Of course, I love for each proc to be able to fill out the FROM on the email without me having to setup a special config for each proc.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)