Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sreevani
Starting Member
1 Post |
Posted - 2006-05-30 : 13:44:17
|
| Hello, I am having a stored procedure like this-----declare @CreatedByAlias varchar(50), @expireat datetime, @mailsent char(3), @status varchar(10)declare cur CURSOR for select CreatedByAlias,expireat,mailsent,status from Issues where status = 'Open' and DateDiff(minute,getdate(),expireat) = 30 and mailsent ='No'open curfetch next from cur into @CreatedByAlias,@expireat,@mailsent,@statuswhile @@FETCH_STATUS = 0BEGIN exec master.dbo.xp_sendmail @recipents=@CreatedByAlias, @message=N'Reminder !!! This issue should be closed with in 30 minutes.' ; Update Issues set mailsent ='Yes' where CreatedByAlias = @CreatedByAlias and expireat = @expireat and mailsent = @mailsent and status = @status fetch next from cur into @CreatedByAlias,@expireat,@mailsent,@statusENDclose curdeallocate cur------I am trying to send mail using xp_sendmail, i can see that the record is getting updated but I am not able to receive any email, can you please tell me why I am not getting the email when this stored procedure is executed. Thanks in advance |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-31 : 06:03:02
|
| What does the sp say when you run it. There should be an email sent message.Try displaying the @CreatedByAlias value and running the xp_sendmail independantly.Does xp_sendmail work on that server?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|
|
|