(c) 1999-2000 dB2K Inc.
The MessageServer is a polling application that runs on any computer on your network that has access to an eMail server and the tables you wish to poll.
It comes pre-configured to work with the dB2K Web Class samples. Once you set up the MessageServer, you may test it live on your local computer. Just set up your Web Server (Apache is shipped with dB2K), run the MessageServer and submit some names to the SignUp Web application using your Browser.
Amazingly, you can see the Server pick up your new data, connect to your network's (or ISP's) Mail Server and send the mail out before your very eyes. In real time.
This is an interesting dB2K application in that it is highly scalable. Just add another machine running the MessageServer and you've doubled the access to your data coming in over the Web or from dB2K Windows applications.
You may use the Message Server for any of the following purposes (among many others):
1) eMail confirmation for online orders.
2) Sharing remote data (send it as text in eMail, parse the incoming eMail back to data).
3) Sending new leads out to a field sales force.
4) Sending orders (or purchase orders) to remote branches.
5) Blasting eMail out to a database-based eMail list.
There are many ways of automatically sending eMail. The advantage to the dB2K Message Server is that it uses a database to accomplish its tasks. That means it can update rows directly as mail is sent, optionally marking rows that have been sent with the date and time. Furthermore, it is, in many ways, failsafe. Assume that something goes wrong with your Internet connection, your network or your database engine. No problem, the next time you start up the MessageServer, it starts over right where it left off.
Logs The dB2K MessageServer generates detailed HTML logs for both successful sends and failures.
Viewer Logs can be viewed on the multi-tabbed MessageServer form.
Reliability All connections have fallback and retries to ensure connection. If your Mail Server goes down, don't worry about it. When it comes up, the dB2K Message Server will pick right up where it left up, making a new connection and sending pending mail.
Before you start, make sure you have a live connection to an ISP or local Server with your eMail Server installed and working.
1) Run MessageServer.wfm from the dB2K 01\Web\MessageServer folder.
2) Click on the Setup tab. Enter the following information:
Your eMail Server address ( mail.myisp.net ) in either Domain Name format or IP address format.
Your eMail account, fully qualified (myname@myisp.net). This will be the "From" address and is required. For corporate use, you might want to set up a new eMail account just for the MessageServer (messages@mycorp.com).
Pick a folder in which to store your logs.
3) Go back to the first tab and click "Start". The form will display progress, the log as it gets written, and a timer to tell you how long it's been sitting since the last message was sent.
4) Click Stop to stop the dB2K Message Server.
5) Check your logs by clicking on the Log tab.
Code
The most interesting code is in the Custom Class Mailprocess.cc. It's highly documented, though the loops that keep checking for new data are a bit complex. Once the server connects, it tries to continue sending all pending messages until they are exhausted, which yields much better performance than connecting for every message you send.
Enjoy it.
AAK 2/2/2000