question on sms/email.

buggiez

Member
Joined
Feb 7, 2006
Messages
18
Location
Singapore
Programming Experience
1-3
Just a question, i am doing an application for reminders. the reminders will be sent via sms/email at a certain date. the date and time will be based on the information i insert into the database. for example, i have a record of date 1/3/2006, time of 8pm. this is the date and time the sms or email will "automatically" be sent.

my question is, how do i implement it in the vb.net project itself? this is because it will be sent automatically instead of the user manually clicking any buttons to allow the email/sms to be sent.


valerie
 
Havent done this before so my experience is limited. But i suppose you could use a timer to check the dates at certain intervals. Or at the start of every day you could have the program retrieve all the dates that are on the same day( if you see what i mean) and read then into a text file or something? then when the times in the text file match the system time raise an event to send the email. I doubt this is the most efficient way, as i said i'm just having a guess here.
 
hmmm... "read them into a text file" seemed to be what i want. my supervisor has asked me to simulate the sms/email service and "read them into a text file". means i dont need to "really" send an email/sms. but i must show that the sms/email are sent.

furthermore, i am going to demo the reminder application(i.e on a certain time of the day). means i will have to show that the sms/email is sent.

any way how to do it? should i do it in a separate vb project itself?

hope someone replies... coz its kinda urgent yea... thanks alot


val
 
there are 2 ways I would consider doing this: one is to write a vb.net exe command prompt application that only reads in a text file and sends the emails and also would log the confirmation of sending the email. The .exe could be setup as a scheduled windows process to run once per hour, for example. Your web app would simply write requested emails into the pre-determined file.

The other option would be to create a windows service in .NET 2.0 and use the directory watcher. When you want to send an email, write a file into the directory that the .NET 2.0 app is watching. That app could then read the file, send the email, etc...

I think the windows scheduled event will be the easiest/fastest approach for you since you are looking for something quickly.

One watchout: remember that the website is a threaded application, so it's possible that two threads would want to read/write to the file at the same time causing locking issues. It can be difficult to handle all of this properly. To deal with this I would recommend using a database. Since this is pretty simple, an Access database would probably work just fine. It can handle the threaded operations and it won't need super-great speed since it's being used for background processing. You could also go with a free more-capable database like MySQL.
 
Back
Top