General discussion



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?



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

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.

Related Discussions

Related Forums