Jeff and .NET

The .NET musings of Jeff Putz

Sponsors

News

My Sites

Writing an SMTP client

The fun thing about my current voluntary break from “normal” work is that I can experiment with code for fun. I can't remember the last time I did that. Ever since I got the book “Professional .NET Network Programming” a year or two ago, I thought it would be fun to try and write a simple SMTP component. The spec is pretty straight forward, so why not?

Today I thought I'd give it a whirl. It might be something I'll include in the next version of POP Forums or something. To my surprise, it really wasn't that hard to whip it up. It's not checking response codes for errors or anything, but it does send mail. I even managed to get basic authentication for ESMTP to work.

I realize it's not rocket science, but it's kind of interesting to write something from scratch even though it has been done who knows how many times. A lot of it is just having an excuse to play with network and stream classes.

I'm easily amused.

Posted: Jul 01 2004, 10:40 PM by Jeff | with 4 comment(s)
Filed under:

Comments

Eric Newton said:

You mean a POP3 or IMAP4 client right?

As far as I know SMTP is more of a "Receive and possible forward" protocol, not neccessarily for retrieving?
# July 2, 2004 1:30 AM

Jeff said:

Yes, that's true. Who said anything about receiving?
# July 2, 2004 10:44 AM

William D. Bartholomew said:

The SMTP bit isn't too hard, but it's the MIME for attachments that isn't fun.
# July 5, 2004 1:24 AM

Jeff said:

Agreed! I started to look at some of open source implementations and decided that going that far would cease to "fun!"
# July 5, 2004 9:32 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)