I did not write the smtp, I canabalized some code. It is working nicely, listening on a port for incoming connections, responding well, and accepting the incoming byte stream of the message on a socket. When it gets to the MAIL command, I have to parse out the from and to email addresses to format the file for relaying. (I have to add x-sender:
email@address.com and x-receiver:
email@address.com to the first two lines of the file) It all seems to be working well except sometimes the HTML part of the message ends up with strange characters or a bunch of spaces (not  ). I am wondering if the streamwriter or the byte array could be messing with the characters or if there is something i am not aware of. The only thing I could think was that each byte is in a format like ASCII or unicode or something like that and when it is output again the characters output as something different...but only sometimes.
I am sure you can tell I am new to this, so please bear with me and thank you for your help...