Sunday, February 19, 2012

How to send mail throuth Trigger ?...

Hi,

I am using Trigger to send me a mail, when ever any DML operation occur on my DepartmentMaster table. my trigger is as follow.

CREATE TRIGGER reminderON DepartmentMasterFOR INSERT,UPDATE,DELETE AS EXEC master..xp_sendmail'MaryM','Don''t forget to print a report for the distributors.'
delete from DepartmentMaster where deptcode = '02'

my out express is configured with default account. but when ever i delete any row from DepartmentMaster table mail is not sent and i get following error..

Server: Msg 18030, Level 16, State 1, Line 0
xp_sendmail: Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client.

Which version of SQL Server are you using?

|||

Sql Server 2000

|||

You need to configure the SQL Mail component. Have a look at:

http://www.evogenic.com/downloads/evo_sql_mail1.pdf SQL Mail Tutorial

No comments:

Post a Comment