DotWish
DotWish

Reputation: 113

.Net - Email sent through outlook should update database

We have to build a small grievance report system. In this users enters their grievance on a ASP.Net page. An email is sent to particular individual of a department. When this individual opens this email in outlook and responds a field in a SQL server table needs to be updated.

How to accomplish this SQL Server update?

Platform : .Net Preferred language : C# Database : SQL Server Email client : Outlook

Thanks in advance

Upvotes: 1

Views: 2227

Answers (2)

DEVMBM
DEVMBM

Reputation: 492

check the following article to receive notification when user reads the email , then check the inbox for all incoming notification and update sql database.

mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;
 //Add "Disposition-Notification-To" for Read receipt
 mail.Headers.Add("Disposition-Notification-To", "");

http://www.midnightprogrammer.net/post/Requesting-deliveryread-receipt-from-C-using-MailMessage-class.aspx

Upvotes: 1

Justin Niessner
Justin Niessner

Reputation: 245459

Instead of putting the details in the email, you should send the Individual a link to a web page.

You can then use the web page to update the database.

The other option would be to set up a Web Service on the server that would update the database. You would then have to call the web service via JavaScript embedded in the email.

Outlook can sometimes be picky about executing JavaScript in email, so the first option would definitely be my preferred solution.

Upvotes: 7

Related Questions