General discussion

  • Creator
    Topic
  • #2189940

    Triggers

    Locked

    by tim.williams ·

    Hi there

    i want to run a script using the jobs in enterprise manager, hopever I want to have a second step which would be to send a mail.

    I want to send a mail to all the people returnbed from the script and use the email addresses found in that returnded data.

    Can this be done?

    Thanks

    Tim

All Comments

  • Author
    Replies
    • #3060231

      Yes but don’t

      by tony hopkinson ·

      In reply to Triggers

      look up the xp_sendmail stored procedure.
      Personally I would not send the mails from within a trigger though. In fact don’t do anything in a trigger, that might take a while.
      Get your script to chuck the required email addresses into a table. Then write a stored procedure to go through it attempt to send, mark it as sent or delete the record, or leave it in for a retry. In fact a retry count would be a good idea.
      A little bit of work and scheduling the mailer to go every x and you’ll have something that could be useful elsewhere.

Viewing 0 reply threads