473,385 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Scheduled email distribution

I would like to schedule at regular intervals an automated e-mail report
from a web server. I have the logic written to send the e-mail in C#.

However, is there a way I can schedule it? How could I trigger the code to
send?

Thanks!
Nov 19 '05 #1
6 1348
You can use the windows scheduler to do this from the operating system. Or
to do it programitically, you could use a Timer:

// start now and fire every 60 seconds
Timer MyTimer = new Timer(new TimerCallback(Callback), null, 0, 1000 * 60);

static void Callback(object o)
{
// send emails
}

Note, you must keep the reference to the Timer alive, otherwise it gets GC'd
and won't fire anymore. So, make MyTimer a static variable.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I would like to schedule at regular intervals an automated e-mail
report from a web server. I have the logic written to send the e-mail
in C#.

However, is there a way I can schedule it? How could I trigger the
code to send?

Thanks!


Nov 19 '05 #2
Create a small windows service that calls a web service method.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Thomas I." <no**********@yahoo.com> wrote in message
news:id*******************@tornado.rdc-kc.rr.com...
I would like to schedule at regular intervals an automated e-mail report
from a web server. I have the logic written to send the e-mail in C#.

However, is there a way I can schedule it? How could I trigger the code to send?

Thanks!

Nov 19 '05 #3
A Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Thomas I." <no**********@yahoo.com> wrote in message
news:id*******************@tornado.rdc-kc.rr.com...
I would like to schedule at regular intervals an automated e-mail report
from a web server. I have the logic written to send the e-mail in C#.

However, is there a way I can schedule it? How could I trigger the code
to send?

Thanks!

Nov 19 '05 #4
Hi, just wondering, are Windows Services generally preferred over a console
app setup within Task Scheduler? I would have thought for something that
happens at regular intervals, itd be easier to do it the latter way, but
maybe i just have sentimental feelings for Task Scheduler.

-Premier JiangZemin

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
A Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Thomas I." <no**********@yahoo.com> wrote in message
news:id*******************@tornado.rdc-kc.rr.com...
I would like to schedule at regular intervals an automated e-mail report
from a web server. I have the logic written to send the e-mail in C#.

However, is there a way I can schedule it? How could I trigger the code
to send?

Thanks!


Nov 19 '05 #5
I'd suggest the OS's task scheduler, as it's alrewady written, rather than
you having to work out some of those details.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi, just wondering, are Windows Services generally preferred over a
console app setup within Task Scheduler? I would have thought for
something that happens at regular intervals, itd be easier to do it
the latter way, but maybe i just have sentimental feelings for Task
Scheduler.

-Premier JiangZemin

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
A Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...ary/en-us/dnvs
samp/html/vbcs_CreatingaWindowsService.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Thomas I." <no**********@yahoo.com> wrote in message
news:id*******************@tornado.rdc-kc.rr.com...
I would like to schedule at regular intervals an automated e-mail
report from a web server. I have the logic written to send the
e-mail in C#.

However, is there a way I can schedule it? How could I trigger the
code to send?

Thanks!


Nov 19 '05 #6
I was thinking about doing the same kinda thing only with a events
notifications senario where events were stored in a DB with date and times
and basically I wanted to have this queried every 1hr or so to remind me of
these events. I was thinking a Windows Service however now that you bring
it up, task scheduler may be a better fit since the timer portion is already
implemented. However, once I grab the date and times of the event reminders
is it best to use Web Services or .NET Remoting to marshal this data across
to my client app? Because we are crossing application boundaries so I would
assume that we have to use one of these methods. Any input would be
appreciated.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:25**********************@msnews.microsoft.com ...
I'd suggest the OS's task scheduler, as it's alrewady written, rather than
you having to work out some of those details.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi, just wondering, are Windows Services generally preferred over a
console app setup within Task Scheduler? I would have thought for
something that happens at regular intervals, itd be easier to do it
the latter way, but maybe i just have sentimental feelings for Task
Scheduler.

-Premier JiangZemin

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
A Windows Service is the most reliable tool for this job.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...ary/en-us/dnvs
samp/html/vbcs_CreatingaWindowsService.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Thomas I." <no**********@yahoo.com> wrote in message
news:id*******************@tornado.rdc-kc.rr.com...

I would like to schedule at regular intervals an automated e-mail
report from a web server. I have the logic written to send the
e-mail in C#.

However, is there a way I can schedule it? How could I trigger the
code to send?

Thanks!


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bart Simpson | last post by:
Hi, I want to control 'Scheduled Tasks' in Windows 2003 by python program. But I couldn't find any Python module about win32 'Scheduled Tasks'. I could find only Perl module about it. (see...
4
by: Colin Steadman | last post by:
We have a number of scheduled tasks on our IIS server that run daily at some point during the early morning. These tasks run as a specific user that has the correct permissions to perform whatever...
3
by: Greg D. Moore \(Strider\) | last post by:
Ok, I thought this one would be easy. I have a stored proc: master.dbo.restore_database_foo This is on database server B. Database server A backs up database foo on a daily basis as a...
6
by: Iain Hosking | last post by:
I am running a SQL Server 2000 installation with several databases. Each database and log is backed-up using a maintenance plan. The scheduled maintance plan for the latest database does not run,...
1
by: teddysnips | last post by:
I'm not a newbie, but I've not been able to find out how to do this particular task, and BOL isn't being too cooperative. My application sits on a SQL Server backend (SQL Server 2000). The...
4
by: michiel | last post by:
Does anybody know how to create a email distrubution list in ms Access thanks
6
by: John Bowman | last post by:
Hi, I have a C# app that needs to launch the "Add Scheduled Tasks" wizard found in the control panel "Scheduled Tasks" applet. I realize that this "applet" really just opens the tasks folder,...
1
by: raghuveer.v | last post by:
Hi, We have a distribution list in our company's outlook address book (exchange server) that has the alias "domain.division" People with the rights to send broadcast mails use this alias in...
2
by: tthomas | last post by:
Greetings, I am using CDO.Message to send email messages from my application. I now need to send email to existing distribution lists in our Global Address List. However, our exchange server...
7
by: sachu | last post by:
Hi, Is there is way to run a php file perodically everyday on scheduled time in such a way that there is no human interaction and it performence the written task.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.