Discussion Locked

Triggers

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

by tony hopkinson

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.

This discussion is closed to new replies.