I am learning vb.net and trying to create a simple program to watch
port 25 and receive email. I do not need any advanced features. I
just need to connect, watch and grab the emails as they come. This
seems like it should be a pretty simple but I can not seem to find any
examples in vb.net 8. Any help is appreciated. TIA
Ok... First things first - you need to understand how to write a server in
VB.NET. For an SMTP server, I think the first thing you should look at is how
to write a basic windows service. You should be able to find examples of that
in the documentation - Look at System.ServiceProcess.ServiceBase.
Once you have that down, you should probably read and study the documentation
on implementing an ayncronous server socket. I encourage you to use the
asyncronous model, even though it is slightly more complicated then the normal
syncronous socket model. It will provide you with much better overall
performance because of the way the async sockets are implemented. There is a
example of a simple server in the documentation. If you don't have the docs,
start here:
http://msdn2.microsoft.com/en-us/library/4as0wz7t.aspx
Once you understand the basic concepts, then you should go to an rfc database
(I usually go to
http://www.rfc-editor.org) and look up the rfc's related to
smtp. You should probably start with rfc2821:
ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt
Then you will probably want to expand from there, like the rfc2554 which
covers service extensions for authentication, etc.
Once you begin writing code and playing with it - post back if you have any
questions. It's much easier to help people with specific issues then the
general "how do i write an smtp server"
HTH