Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How would I get a web site to Delay sending an email for  5 min (ASP.NET C)#

Posted on 2014-07-22
5
Medium Priority
?
423 Views
Last Modified: 2014-07-29
I don't know how to go about this, and am looking for some direction.  I need my site to send an email out, but this is the issue.  Send it out 5 minutes after they click the button, or close the browser.  Is this possible and if so, how?
0
Comment
Question by:bmanmike39
  • 2
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 2000 total points
ID: 40213380
Send it out 5 minutes after they click the button

// Make thread to pause for few minutes
System.Threading.Thread.Sleep(300000);
// Your code for sending email here

Open in new window


More details available at - C# Sleep
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 40213688
Normally you would have a separate service to handle sending the email at an appointed time, or after a specific delay. You certainly don't want to be sleeping a thread in a web application as suggested above!
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40213868
I do agree with Carl Tawn. The solution was suggestive but not recommended for production environment. Thanks Carl for pointing it out.
0
 

Author Comment

by:bmanmike39
ID: 40218544
If this is not safe than it will not work for me.
0
 

Author Closing Comment

by:bmanmike39
ID: 40228419
Thanks but this is no good to me if it's unsafe, but no one is responding.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question