I have to test some C# code which sends simple HTML content with Attachment through SMTP server. How can I make sure my code works. My machine is Vista and have IIS-7, I don't want to connect to any external SMTP
If you want to test by actually sending email, you can install a free SMTP server on Vista. If you don't want the message to go anywhere, you could consider implementing at least part of SMTP in a diagnostic program. I did this recently - it's not all that hard if you just want to capture the messages and aren't trying to write a real server.
I normally test with an installation of Apache James, which has a full featured smtp & pop3 server, it is a java server so you only need the JRE installed. I install it in the same machine I'm debugging, I'd recommend though that you have to follow some of the tutorials on its wiki to install it correctly, it installation is not really that intuitive.
How about using a "Fake"SMTP Server like http://ndumbster.sourceforge.net/default.html