How to execute a program when an email is received?
I am writing an intranet application for my company, and there is a transport reacquisition system. When someone posts a request, and if the manager is not the one sending the request, the manager receives the request as an email so he can approve it. The point is that when he forwards that mail to a certain email address a program should d开发者_如何学Goetect that email and execute query.
How can I achieve this?
The usual way to do this is to have a scheduled job that reads a mailbox. Most mail servers support POP, so you could use a POP client, like C#Mail. The scheduled job logs in to the mailbox, retrieves the mail, and deletes it when it's done.
Wouldn't it make more sense to have a link in the email that hits a web page that calls the database?
There is no guarantee on email delivery so you can't assume that the forward from manager actually gets there in a timely manner. Which leads me to ask: why isn't there a web page that the manager can view and approve requests?
精彩评论