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
381 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now