Programs - NewMail


Aim

The reason for writing this program was that when you login on a Novell network, it shows how many mail messages you have but not who they are from, etc. So I wrote this program to search from all your mail messages, extract the sender, subject, date, time and whether it had been read. It then displays the information in a easily readable fashion on the screen.

Method

To search for a spare drive and map it just so you can look at the mail seemed a tedious, slow and unnecessary process, so I decided that when it logs in it must map a drive to my mail directory, easy enough. Then at the end of my menu (a simple batch file using echo commands) it should run the program to display my mail. It could tell it what directory to look in at that time. So the program looks in the directory specified on the command line.

The program searchs for .cnm (the extension of mail messages) files, and for every file it finds it reads from it the sender, subject, date and time. It determines whether it has been read from the file name of the message. All of this data goes into a linked list which is dynamically allocated on-the-fly.

If it doesn’t find any messages the program quits at this time. If it does find some messages it gives a audible indication - this is not done if the shift key is held down. Once this is done, it displays the messages, between dashed lines, on the screen. Each messages takes two lines, the first shows the sender and whether it has been read and the second line show the subject, date and time. The date and time only contains the day of week, date, month, hour and minute that it was sent. The program filters out: year and timezone infomation.