Hello Munish,
I'm not going to answer every question. You are a student. However, I will
help you to look at the problem, and ask some questions that you should be
prepared to answer.
First off, you didn't say if your assignment was to create a windows form
application or a web form application. However, it is far easier to
develop this kind of application in a windows form, so I'm assuming that you
have not been asked to do the really hard stuff just yet.
Think about it logically:
you can't send an e-mail without at least two bits of information: the
destination address and some text for the e-mail message (header or body).
So make sure you get some basic information before going further. (a pop-up
window is good for that... what call will put up a message for the user to
see and allow them to click an OK button?)
Once you have the e-mail information, you need the date. Users type into a
text box or a date picker control. If you use a text box, make sure it is
really a date. (Is there a call that you can use to convert that string to
a date type?)
Now, logically, there's three possibilities: either the date has already
occured, it refers to today, or it refers to a date in the future.
If it has already happened, you can either send it anyway or put up a
message telling the user that C# cannot travel through time.
If it is now, you can ask the user if they want to send it right away, or
you could just send it.
If it is in the future...
Well, at home, if you have an envelope that you want to mail tomorrow
morning (the future), what do you do with it? Do you carry it around all
day? Do you sit quietly in a chair waiting for tomorrow to come? Probably
not. You probably place it somewhere that you will look at tomorrow, and
continue with your day. In the morning, when the time comes, you pick it
back up.
Same thing in a program. Place the message in a list that hangs around.
Then, do other things.
So how do you remember to pick it back up?
At home, you know it is the right time to pick up your envelope when you
look at the clock and it says (for example) 7:00 am. You probably look at
the clock 10 times a day.
So, how often should your program look at the clock? And how will you get
your program to check the clock every hour?
Do you know of a call that will return the current date and time?
Do you know of a method for having a bit of code execute every XX seconds?
If you can answer these questions, you are well on your way to solving this
problem.
--- Nick