Email from web without tying up webpage

大兔子大兔子 提交于 2019-12-11 05:19:01

问题


I have a web app that handles work requests. It emails the users involved on new, changed, and completed requests. The problem is, when it sends the email it takes a while for the page to load. Without the email process, it works fine. I'm using CDO to send messages now directly from the code-behind. Is there a better way that won't tie up the webpage?

I've considered possibly running an exe independently after a request is changed. Is there a way to shell a script that will handle the email, but continue forwad with the webpage load so the shelled script runs independently from the code-behind of the page?


回答1:


You might consider queuing the emails in a database table or a text file that is read by a dedicated service.

Writing the email to the database or text file will be quick, and the service only needs to check for changes every few minutes.

Problem would be you can't notify the user that the email didn't send, though you would have the same problem trying to shell execute another program.



来源:https://stackoverflow.com/questions/13180991/email-from-web-without-tying-up-webpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!