Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 7.0 Triggers and xp_sendmail function...

Status
Not open for further replies.

cjohnson6

Technical User
Jul 19, 2000
21
0
0
US
My name is Claude Johnson and I am trying to develop a new Trigger within our local database that will allow me to use the 'extended sp' command, 'xp_sendmail'.<br><br>I have attached a copy of my syntax below for review.  With this trigger I hope to verify a field has been changed (verified_password) and then send an email to the candidate in question but instead of an email, I want to send a link to an ASP page.  The ASP page is called 'verifypassword.asp'.<br><br>Can this be done with the xp_sendmail command as I've tried below?  If not, what other options would you guys suggest?<br><br>Any information would be appreciated.<br><br>Thanks in advance,<br>Claude Johnson<br><br><br>CREATE TRIGGER [Trig_VerifyPassword] ON [t_candidate1] <br>FOR INSERT, UPDATE<br>AS<br><br>Declare @verified_password  smallint,<br> @sendmessage  varchar (200),<br> @send_candidate  varchar (100),<br> @send_fname  varchar (50),<br> @send_lname  varchar (50)<br><br>SELECT @verified_password = B.verified_password FROM t_candidate1 B, INSERTED I<br>WHERE I.candidate_id = B.candidate_id and @verified_password = '1'<br> <br>--send email with link so that candidate can verify password<br>select @send_candidate = @send_fname + ' , ' + @send_lname<br>select @sendmessage = @send_candidate + ' , please initiate the following link: ' + 'verifypassword.asp' + ' so that your new password can be verified.'<br><br>exec master.dbo.xp_sendmail @recipient =  @send_candidate, @message = @sendmessage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top