Triggering an event in Windows service every 1 hour.

Hello,

I want to create a windows service that will send a mail to a mailing list 
every 1 hour.

How do I program so that the mail event automatically triggers every 1 hour.

(If I use timer and the service starts at odd 12:33, then it will fire event 
at 1:33, 2:33... . But, I want it it fires at 12:00, 1:00, 2:00 irrespective 
of when it starts.)

How do I do this?

 

0
Biranchi
2/21/2010 3:43:35 PM
dotnet.framework.aspnet 1425 articles. 0 followers. Follow

3 Replies
1478 Views

Similar Articles

[PageSpeed] 45

hi Biranchi,

On 21.02.2010 16:43, Biranchi Narayan Panda wrote:
> I want to create a windows service that will send a mail to a mailing
> list every 1 hour.
>
> How do I program so that the mail event automatically triggers every 1
> hour.
>
> (If I use timer and the service starts at odd 12:33, then it will fire
> event at 1:33, 2:33... . But, I want it it fires at 12:00, 1:00, 2:00
> irrespective of when it starts.)
>
> How do I do this?
So what is your concrete problem?

Creating a Windows service?

   http://msdn.microsoft.com/en-us/library/d56de412%28VS.80%29.aspx

Waiting x seconds?

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/660a1f75-b287-4565-bfdd-75105e0a5527

Sending e-mail?

http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx


mfG
--> stefan <--
0
Stefan
2/21/2010 3:56:16 PM
I want that the mails should go at whole hours, I.e. at 12:00, 1:00,2:00....
and not like 12:01 , 12:02....
I want the mails to go at starting of hours(  x:00)

please help



"Stefan Hoffmann" <ste5an@ste5an.de> wrote in message 
news:uiT5o5wsKHA.732@TK2MSFTNGP06.phx.gbl...
> hi Biranchi,
>
> On 21.02.2010 16:43, Biranchi Narayan Panda wrote:
>> I want to create a windows service that will send a mail to a mailing
>> list every 1 hour.
>>
>> How do I program so that the mail event automatically triggers every 1
>> hour.
>>
>> (If I use timer and the service starts at odd 12:33, then it will fire
>> event at 1:33, 2:33... . But, I want it it fires at 12:00, 1:00, 2:00
>> irrespective of when it starts.)
>>
>> How do I do this?
> So what is your concrete problem?
>
> Creating a Windows service?
>
>   http://msdn.microsoft.com/en-us/library/d56de412%28VS.80%29.aspx
>
> Waiting x seconds?
>
> http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/660a1f75-b287-4565-bfdd-75105e0a5527
>
> Sending e-mail?
>
> http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx
>
>
> mfG
> --> stefan <--  

0
Biranchi
2/21/2010 4:34:21 PM
hi Biranchi,

On 21.02.2010 17:34, Biranchi Narayan Panda wrote:
> I want that the mails should go at whole hours, I.e. at 12:00,
> 1:00,2:00....
> and not like 12:01 , 12:02....
> I want the mails to go at starting of hours( x:00)
The naive approach should be sufficient as it does not consume to much 
CPU load:
Wait 60 seconds and test for the full hour.

Otherwise: Calculate the difference to the full hour after every operation.


mfG
--> stefan <--
0
Stefan
2/21/2010 6:18:25 PM
Reply:

Similar Artilces:

Receiving all mail in Outlook Exp, but not in Windows Live
I receive mail through a PC on Outlook Express. When I check my mail on my laptop through Windows Live I don't receive all my mail. It is not the same sender. One day I will receive mail from sender X on my laptop, and one day I wont. -- michele If both computers are using the same e-mail address, on both machines: Tools | Accounts | Mail | Properties | Advanced - Check: Leave a copy of messages on the server. On one machine only, check to Delete messages after X days to satisfy your allotted space you get from your server. -- Bruce Hagen MS-...

windows update kb976321 and kb981726
i have tried to install these several times but they keep failing. i get error code 646 but nothing seems to help. what else can i do to fix this? DiamondBailey wrote: > i have tried to install these several times but they keep failing. i get > error code 646 but nothing seems to help. what else can i do to fix this? For Office updates, the 646 error is usually resolved by inserting the Office CD *prior* to the attempted installation of the updates or by manually downloading the full file versions of the updates from the MS Download Center and then installing them manually...

Event of closing a form or navigating away
I need to use some code to update some tables after entering a new record or editing an existing record. I need to know what event I should use. I know after entering a new record, we can navigate away from current record, or the form can be closed. I don't what else can happen to get away from current record. Please give me some suggestions regarding how we should catch these events. Thanks in advance, Guangdew -- Message posted via http://www.accessmonster.com On Fri, 26 Feb 2010 01:10:38 GMT, "guangdew via AccessMonster.com" <u58044@uwe> wrote: &g...

Rob...Cost update trigger
I found a post that originally included a cost update trigger that Rob had created. It updates the sales price based on a new cost. I can't get the attachment anymore. Anybody out there have the trigger? Thanks, G E ...

Trigger email
Is there a way that you can have a countdown and when the countdown reaches 0 for it to automaticly send out a email to a certian person? You will first have to determine how you are going to calculate your countdown. Then try the following: Dim strSubject As String Dim strAddress As String Dim strMessage As String Dim blSendEmail as Boolean strSubject = "Countdown reached zero" strMessage = "This is the message that will be the body of the email." If 'This is where you would put the countdown check value' Then ...

Cancel sheet change event
Is it possible to cancel the sheet change event if the sheet is a chart sheet? Hi, Can to elaborate? A chart sheet does not have a Change event. Do you mean the SeriesChange event? Cheers Andy NSK wrote: > Is it possible to cancel the sheet change event if the sheet is a chart sheet? ...

Windows XP Home SP2 and Outlook 2002 with Word as editor
I have Windows XP home one my machine and run the Windows XP Service PAck 2 froma a CD Supplied by Microsoft. after the upgrade everything was working as normal until the Automatic update that took place on Thursday 14th October which included the following:- Critical Update for Office XP on Windows XP Service PAck 2 (KB885884) and Cumulative Security Update for Internet Explorer for Windows XP SP2 (KB834707) After this I had problems with Outlook not recognising Word as my e-mail editor and even after performing the fix as set out in Article ID 319796 I still have no joy with Outlokk a...

how to divide a numbers in a table of data by 1,000, all at once
I've noticed in some spreadsheets that numbers are displayed as rounded...i.e. so that one isn't looking at 1,403,333 + 2,333,999 etc. but rather 1403 + 2334, etc. with a note at the top that says "000's". In one step, how can I edit all the numbers in a table so that they show to the nearest 10,000 (i.e. 1403 +2334), without dividing them one by one by 1,000? Or, to go at it from another angle, how do I divide each # by 1,000? The ROUND feature requires that I create a new table. Not exactly what I'm looking for. Enter 1000 in an unused cell. ...

Event Manager
I own an outdoor store that sells training classes, tours, seminars, and similar type items. I currently use another POS system in the store but would like to use MS RMS, because I have it at another location and would like all locations to be the sames software. What I need is an RMS add in that manages events I mentioned. Ideally the software would allow me to create the event and schedule the same class multiple times and allow the class to cross multiple days, such as 2 consecutive sundays. The software would allow the sale to occur at the POS. The software would create a roste...

How do I change the size of the automatic window outlook
Can I change the size of the initial window that outlook opens up into? I do not like it when it takes up the whole screen. "bhanley" <bhanley@discussions.microsoft.com> wrote in message news:E723FC0E-546B-4400-A689-0B1289EB0DEB@microsoft.com... > Can I change the size of the initial window that outlook opens up into? I > do > not like it when it takes up the whole screen. Make sure the shortcut you're using to start Outlook isn't specifying that Outlook should open maximized. If it's not, then size it the size you want by dragging the...

Carry on with Windows Server install
I am starting to like the 2008 server series. Question about the REmote Desktop : How does the licensing work? We might need 2 additional clients. -- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.myspace.com/502748630 Born 29 Jan 1969 Redhill,Surrey,England UK Hello The, There is no change as before, as far as i know, 2 administrative connections and if you need more you have to buy TS CALs and install a TS licensing ser...

WORD problem after Office 10.1.4 upgrade
After installing Office X 10.1.4 upgrade I keep getting error message: "Word has unexpectedly quit". Also an error message when bringing up Excel. I wonder if anyone has seen this problem? I appreciate any feedback. Thank you. ihold <ihold@comcast.net> wrote: > After installing Office X 10.1.4 upgrade I keep getting error message: > "Word has unexpectedly quit". Also an error message when bringing up > Excel. > > I wonder if anyone has seen this problem? > I appreciate any feedback. Thank you. Do you also see this with Excel or PowerPoint ??...

Every time i type a date in a field it turns it into ######
I am getting the number sign (#####) in place of dates whenever i try to type or paste into my worksheet. How do i get it to show the dates and not the number signs??? Thanks make the cell bigger "maria06074" <maria06074@discussions.microsoft.com> wrote in message news:12417F9F-E0E4-4319-A4EE-6B2D9342529D@microsoft.com... >I am getting the number sign (#####) in place of dates whenever i try to >type > or paste into my worksheet. How do i get it to show the dates and not the > number signs??? > > Thanks > ...

How can I remove time from event banners?
Installed Outlook on new laptop and transferred over info. The banners on my all day events now include a time of 12:00am. I have tried everything to get rid of the time. How can I get the times off the banners? How did you transfer the info over? Usually you need to open each one and fix the time but if you used import, open the pst directly in outlook instead and see if they are ok. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subs...

Windows Server 2003 Service Pack 1
Has anyone applied thjis service pack and where there any issues. Thanks Ken Hi I am currently testing Win2k3 SP1 on our test server. I am sure there will be no issues, just make sure you have the latest SQL SP and hotfixes installed before applying SP1 Regards James -- Visit MGP Central on http://spaces.msn.com/members/hushdontspamme/ "Ken Foster" <anonymous@discussions.microsoft.com> wrote in message news:11d801c5360d$1a2738e0$a601280a@phx.gbl... > Has anyone applied thjis service pack and where there any > issues. > Thanks > Ken ...

double window split?
Can you have a double window split or freeze pane in a excel worksheet? Header rows at top do not move and the footer rows at boottom do not move, the text in between can dbe scrolled. Is this possible? Excel supports one freeze panes or one split. Maybe you can use window|new window followed by window|arrange to do what you want. MMille wrote: > > Can you have a double window split or freeze pane in a excel worksheet? > > Header rows at top do not move and the footer rows at boottom do not move, > the text in between can dbe scrolled. Is this possible? -- Dave Peters...

Trigger
CREATE TABLE tblA ( Symbol varchar(50) NOT NULL, APIFormat varchar(50) NULL, DataFormat varchar(50) NULL ) I would like to do the following: If a new row is added or APIFormat is edited, and DataFormat is not being updated, I would like to set DataFormat like this: If RIGHT(APIFORMAT,1) = '#', then SET DataFormat = LEFT(APIFORMAT,LEN(APIFORMAT)-1) + '0' If right(apiformat,1) <> '#', then SET DataFormat = APIFORMAT If I do the below trigger, if I don't update DataFormat, it sets it correctly, but...

Event 12002 Errors
We are seeing the following error logged every couple of seconds for a user here. His mailbox has been removed (deleted and purged) and we are STILL seeing this error. Does anyone have any ideas what would cause this or how to stop these errors? Error 8004011B-820003A2 occurred while processing message <> from 'David Morris'. Thanks in advance, Jim FYI HOTFIX 829093 fixed this problem for us. http://support.microsoft.com/default.aspx?scid=kb;en-us;829093 Mention that this is a free hotfix, when you contact Microsoft Support Services (800) 936-4900 for the hotfix. It requir...

2 home PC's networked
Hi folks, Here's my problem ... i have two PC's in my house and thet are newworked, but they both were stand-alone for a long time. First question - is it possible to 'merge' the email folders on them (contacts already the same by using phone / activesynch) and secondly, is it possible to have only one copy of iutlook active in future, no matter which PC i work on (so all the emails and replies will be in the same place )? Many thanks and seasons greetings to all, Garry +353 87 238 5832 Ireland Garry Kennedy <garrykennedy@pobox.com> wrote: > Here's m...

Service Pack 3
Looks like SP3 is out for RMS... however, in the knowledge base article, the issues fixed are here: https://mbs.microsoft.com/partnersource/resources/support/selfsupport/hottopics/rms/HotfixList.htm However, that requires partnersource access.... can anyone find a list of changes made in SP3, or would be able to post what's contained on that Hotfixlist? Thanks, Jared https://mbs.microsoft.com/customersource/support/downloads/servicepacks/RMSSP3.htm "Jared" <jared@2amconsulting.com> wrote in message news:1117733079.018701.289160@g49g2000cwa.googlegroups.com... >...

could not unregister BLM trigger
Hello: One of our Dynamics GP 9.0 clients is experiencing an unusual error message when exiting Report Writer and returning to GP. Although the error message is not priventing them from using Report Writer or GP, it is a point of interest. And, I would like to see what can be done to eliminate this message. The message is "Could not unregister the BLM trigger." Does anyone know what this means or how to eliminate it? I do not know, as of yet, if all workstations get this message or if even only just some users get this message. Thanks! childofthe1980s Hi I would sugg...

Macro With Timer Event
I wish to write a macro using the normal tools which consists of a simple copy/paste over series of events. How can I incorporate a timer to delay the copy/paste events for something like 30 to 60 seconds? Is there a useful bit of code that I can obtain and paste into the code that I will be creating or will it require something like a hidden dialogue box with a timer on it? VBA has a function called Timer, a long-type integer that represents the current number of seconds since midnight. You can use this in code to create a delay of a number of seconds like this: Sub Delay() Dim Beg As Lo...

SQL Triggers in Headquarters
We are planning on implementing RMS and Headquarters for our multiple-store retail sales (do not have it installed yet). We are also going to have a virtual store, which will sell items from our brick-and-mortar store inventory. Without getting into too many details at this time, we have determined that the best way for us to accomplish our business needs is to have an external SQL database which will be used to keep track of brick-and-mortar store inventory and will also be used to record virtual store sales. We would then have triggers on this database and on the Headquarters databas...

Trigger on IVR10015
I'm trying to find a way to capture the actual created date on new items when the item copy function is used (when you use the copy function it stores the created date of the source item as the created date of the new item). We have manufacturing but we don't have the QA module, so I was trying to add a trigger to IVR10015 to put the current date in the QA Start Date field and or the QA End Date field upon insert to IVR10015. When I do that and add a new item I get the message below. How can I tell what the constraint is that is being violated? Any other ideas on how to capt...

Windows XP boot problem
Hi, I have a Del netbook which is loaded with Windows XP. I've not had need to use the netbook for about a fortnight and on trying to boot it up today I find that I cannot get past the boot screen ( the screen that has the MS Flag and the words "Microsoft Windows XP" and below these a scroll bar). The scroll bar is constantly scrolling from left to right, as it always does, but for reasons best known to the netbook, this is as far as it gets. The mouse is not yet visible Any suggestions as to what the problem(s) mey be would be much appreciated -- Cheers P...