-3

I am using SQL server email client.

I am sending mails using

EXEC msdb.dbo.sp_send_dbmail                                                                           
    @profile_name = 'Mailer_Profile',    
    @recipients = @Email,      
    @copy_recipients = @ccRecipts,    
    @body = @MESSAGE  ,                                                                           
    @body_format = 'HTML',        
    @subject = @SUB

In the @MESSAGE we are putting some information , when the mail will be opened , it has to be downloaded from our Database end. We need to track this. i.e. when it was downloaded or which mail ID it has downloaded.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Surajit Biswas
  • 779
  • 7
  • 25
  • 1
    -1, no clear objective. Clarify your question. How do you expect the callback to happen? You'll likely need an HTTP server of sorts to handle the request for the link, presenting the user the requested content while logging the request as well. – Mels Oct 08 '13 at 08:50

1 Answers1

2

You want know if the mail has been opened, or has the link been clicked and some data downloaded?

If the former is true, then there's no way to check this from sql server. Over here you can check sent_status field, which has three values for: 1=sent, 2=failed and 3=unsent. But no value for delivered.

SELECT * FROM msdb..sysmail_mailitems

If you want to check if the user has clicked the link, then your code EXEC msdb.dbo.sp_send_dbmail doesn't help much, because we don't know what is supposed to happen when the user clicks the link, and you'll have -10 for this question very soon :).

AdamL
  • 12,421
  • 5
  • 50
  • 74