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
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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