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
391 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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:…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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