You are here:

C#/Scheduled Email



I want to send scheduled email in C# without using any event.
Some code that can send mail regularly based on some conditions or base on date/time.

Please Help.

ANSWER: Hi there,

Simply use timer with interval you desire.

See here for mail sending code.

Hope that helps,


---------- FOLLOW-UP ----------

QUESTION: Thanks For Reply.
I have code to send mail. But question is about timing.
How to create this timer that can automatically fire event and send mail even no one is working on the application.

ANSWER: To clear things up, are we talking about windows forms or web?

---------- FOLLOW-UP ----------

QUESTION: I am talking about WebApplication.

Let me explain. I am making Invoice in my application. Now for unpaid invoices I want that by every 15 days clients with unpaid invoices get email that their payment is remaining. So I want some trigger or timer that can do this.

I hope this will help you to understand.


You have to create a windows service or a desktop app and install on server to achieve this. Another trick could be that (only if you have at least 1 visitor every day) you check last mail sent date in global.asax at session start event and if 15 days past, you send mails and update database. Keep in mind this is generally not preferable as if noone visits your site mails will never be sent.


All Answers

Answers by Expert:

Ask Experts


Murat Mehmet


I can help with questions about desktop and web programming in C#, including SOAP, XML, database managing, custom controls, security etc.


I have been developing web and especially desktop applications in C# and VB.Net for almost 5 years. My programming life has begun with VB6 long time ago, so its about 8 years that I am in this business.

Was in R & D for 2 years in a popular Turkish technology website:

2011 Computer Engineering graduation in University of Trakia in Turkey.

©2017 All rights reserved.