简体   繁体   中英

Writing data from email to SQL server 2008R2

Following our company processes, our database has to send an email to a manager requesting for approval for some document record changes.

I was wondering if it was possible for the manager to reply to the server with an email containing "Yes" or "Approved" with the document# and have it update the document record accordingly. Right now, the manager has to send the QA dept the approval email, and they have to update the document record manually.

I have looked at SQL Mail, but it seems to be a bad way to go according to a lot of places.

We use Exchange 2010 and SQL Server 2008

Thanks!

Do you have IIS installed in your environment? If so, you can redirect the user from Mail (Outlook) to a service page to update the document approval flag.

If so, create a ASP or ASPX page that takes two query parameters. A document id and a approval notice.

Put two links in the email for the manager to click. You will have to send the email from SQL server with a HTML body. Enclosed are sample links for document 123.

<a href="http://internal-site.mycompany.com?id=123&action=yes" target="_blank">Approve Change</a> 

<a href="http://internal-site.mycompany.com?id=123&action=no" target="_blank">Reject Change</a> 

Check out www3schools link below for details query string.

http://www.w3schools.com/asp/coll_querystring.asp

Check out the link below for details on working with databases.

http://blogs.msdn.com/b/morebits/archive/2010/09/26/working-with-data-beginners-guide-to-database-in-asp-net-web-pages-part-1.aspx

As an added feature, you might want to record the Active Directory (Windows Login) of who approved or rejected the document. That way, someone can not approve the document themselves. A date/time might be also handy.

This is one of many solutions you can use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM