Hi All,
I have taken over some code that listens on port 25 and does the
following:
private byte[] buffer = new byte[BufferSize]; // Receive buffer.
While there is data:
......
bytesRead = clientSocket.Receive(buffer, 0, 1024, SocketFlags.None);
......
content = Encoding.ASCII.GetString(buffer,0,bytesRead);
my problem is that when I receive japanese chars they are represented
as:
=E5=8C and so on. Surely this isn't right? I tried:
content2 = Encoding.Unicode.GetString(buffer,0,bytesRead);
and this just converts all the text, be it ascii or not to garbage. If
someone could point me in the right direct that would be great. I
guess what I'm after is how should I read the stream to make the best
use of the data. Is there a way of knowing the incoming encoding for
SMTP?
Basically what the system does is:
listens on port 25; reads the message; changes a string in the message
and then inserts the blob into a database; the blob is then sent on to
a list of people as an email
Cheers
-m