This sample uses a webmail system to demonstrate how to use the Internet Mail Client Control Library on your ISS/ASP site. Using this sample you can:
The Webmail sample may provide a useful starting point for your own application but it's not a complete solution - in particular you should consider the following points -
Files in the webmail sample
Figure 1 shows the relationship between the asp files in this distribution.
Presents the user with a simple HTML form to provide the details needed by the webmail sample.
Note In a production system you'd be more likely to store the user's POP3 and SMTP details locally and have a site specific login.
Connects to the POP3 server, gets the message headers and presents the user with a list of messages in the maildrop. This page uses POP3TOP rather than RetrieveMessages so that only the message headers are retrieved.
Note The sample does not sort the messages in the inbox - they are presented in the same order as the POP3 server returns them, in a production system your users may well expect to be able to sort the messages by Sender, Subject or Date.
Displays the message text and a list of attachments.
Note Only the text/plain sections of the emails are displayed. You will need to decide which textual parts of the email are displayed. Showing text/html sections is tempting but you need to consider if a sender could post malicious HTML and compromise the security of the system. Advanced application may also wish to take into consideration the semantics of the various multipart/* content types.
Deletes a message from the maildrop, redirects the user back to wms_inbox.asp.
This sample does not present the user with an opportunity to confirm or cancel the deletion.
Allows the user to compose an email.
Note It would be cool to allow the user to attach files to the email.
Sends a message to the SMTP server, redirects the user back to wms_inbox.asp.
This sample does not present the user with an opportunity to confirm or cancel the sending of the email.
Clears the IIS session and redirects the user back to wms_login.asp.