Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows service to monitor email server

Status
Not open for further replies.

jayy66

Programmer
Aug 21, 2006
56
US
Hello everyone,
I need to create a windows service that will monitor the emails on an exchange server. I really dont know where to begin.

The service needs to check the server every 60 seconds and parse the text in each email to determine priority. I know how timers work...I've just never coded something of this nature before.

If anyone has any sample code or links to get me started, i would really appreciate it.

Thanks.
 
I don't have my links here but for some tips, you can start reading on how to use TcpClient with IMAP and/or POP. The mailserver is basically watching IMAP/POP ports (143 and 110 respectively) at a particular IP (of the mailserver) for IMAP/POP commands.

For reference on IMAP, POP and MIME, you might want to look on these RFCs (just google them down):
rfc3501
rfc2045
rfc1939
rfc1730

To build the project, you can follow these rather general steps:
1) Create a console app that connects a TcpClient to the mailserver. Try sending login commands for IMAP/POP and see the returned stream if it returns OK. Return values are always in plain ASCII text.
2) If you're ok already with this simple handshaking between the mailserver and your app, now implement the query commands for IMAP/POP. IMAP4, btw, has commands that can fetch for new mails.

If you're ok already with sending commands and parsing the server response, then you'll be ok with fetching mail. [wink]

Next stop is building a windows service with a timer for the actual checking.

Hope this can help you get started. [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top